How could I log in automatically at a page.. page requires username and password.
any suggestions?
thanks.
Auto log in and auto surfing
Moderator: General Moderators
Depends what you want to do. I wrote a script that logs into a forum and updates my signature every 15 minutes .. I used cURL. ( http://www.php.net/curl )
Simple POST example with curl.
Details can bu found http://curl.haxxe.se or http://php.net/curl/ good luck.
Code: Select all
<?
$var1 = 'username';
$var2 = 'password';
#start curl session
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://www.site.com/test.php"); curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"var1=$username&var2=$password");
curl_exec ($ch);
curl_close ($ch);
?>