how to login to another site via PHP

curl will do that PHP, cURL post to login to WordPress

but you will need that installed on the server which is sometimes not an option. There is however loads of scripts that can do the same thing as curl without the curl libs installed, eg: cakephp's HttpSocket class


There are few ways to do the job (actually, you just need to send POST data to the other site).

You can use :

  • curl (example: http://davidwalsh.name/execute-http-post-php-curl),

  • stream context (example: http://php.net/manual/en/function.stream-context-create.php),

  • or directly with sockets (example: http://www.jonasjohn.de/snippets/php/post-request.htm).

Tags:

Php