By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,188 Members | 832 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,188 IT Pros & Developers. It's quick & easy.

PHP - Verify username and password of remote website

P: 1
I am not a programmer, i want to check the username and password of remote website using php curl script. I have to code but it doesnt work. Can any one make changes to this script and make it workable?

Here is the script
Expand|Select|Wrap|Line Numbers
  1.  
  2. $username="yumiyao0926"; 
  3. $password="yumiyao0926"; 
  4. $url="http://www.hotfile.com/login.php"; 
  5. $cookie="cookie.txt"; 
  6.  
  7. $postdata = "email=".$username."&password=".$password; 
  8.  
  9. $ch = curl_init(); 
  10. curl_setopt ($ch, CURLOPT_URL, $url); 
  11. curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
  12. curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"); 
  13. curl_setopt ($ch, CURLOPT_TIMEOUT, 60); 
  14. curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0); 
  15. curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); 
  16. curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie); 
  17. curl_setopt ($ch, CURLOPT_REFERER, $url); 
  18.  
  19. curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata); 
  20. curl_setopt ($ch, CURLOPT_POST, 1); 
  21. $result = curl_exec ($ch); 
  22.  
  23. echo $result;  
  24. curl_close($ch);
  25.  
  26.  
  27.  
Username and password enter in the script works. I just want the script to return successful or unsuccessful result.
Mar 8 '12 #1
Share this Question
Share on Google+
1 Reply


PsychoCoder
Expert Mod 100+
P: 465
Well for starters where did you get this code. Since you said you're not a programmer it tells me you picked this code from a site. What's the code doing versus what you need it to do?
Mar 10 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.