First thing that I should tell you is I'm a newbie to PHP. so mates, I need to create a page that can accept username and password from user and then pass them to another website to check whether the user exist on that website or not. It is like, my page is located at "www . mywebsite . com/check.php". now when someone open this page it should ask for the username and password of another website, say, "www . anothersite . com/login.php" and when user hit the "check login" button it should then pass the username and password to "www . anothersite . com/login.php" and check if it can login using the username and password provided by the user. if the username and password is correct then it should log in to that website (www . anothersite . com) and check the real name of user. I can handle the most of it, but I cant find my way around that log in part. Cant get it to log into another website. Can someone help me please ?
It's easy if you use Curl: curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); with postdata in the format: name=value&anothername=anothervalue
thanks much, but can you please explain it more ? Please explain the method to use that function and variables. Thanks.
If you look in the source of the site you are curling, all the input fields have names. The postdata string is just a string, containing all the inputfieldname=inputfieldvalue, joined together with a "&". If you want more information, php.net has got some awesome documentation on curl (http://www.php.net/manual/en/book.curl.php)
you can use file socket programming in php to send receive data on other domain http://php.net/manual/en/function.fsockopen.php