PHP - Verify username and password of remote website

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hariharakumar
    New Member
    • Mar 2012
    • 1

    PHP - Verify username and password of remote website

    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
    Code:
    $username="yumiyao0926"; 
    $password="yumiyao0926"; 
    $url="http://www.hotfile.com/login.php"; 
    $cookie="cookie.txt"; 
    
    $postdata = "email=".$username."&password=".$password; 
    
    $ch = curl_init(); 
    curl_setopt ($ch, CURLOPT_URL, $url); 
    curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
    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"); 
    curl_setopt ($ch, CURLOPT_TIMEOUT, 60); 
    curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0); 
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie); 
    curl_setopt ($ch, CURLOPT_REFERER, $url); 
    
    curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata); 
    curl_setopt ($ch, CURLOPT_POST, 1); 
    $result = curl_exec ($ch); 
    
    echo $result;  
    curl_close($ch);
    Username and password enter in the script works. I just want the script to return successful or unsuccessful result.
  • PsychoCoder
    Recognized Expert Contributor
    • Jul 2010
    • 465

    #2
    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?

    Comment

    Working...