I have this script, it checks if an account information is valid or not, then says if it is or not.
It is not working for some reason.
By the way, make a free account here and check, I have my own private accounts to check with:
https://secure.runescape.com/m=create/index.ws
Or use this login information (DO NOT CHANGE THE PASSWORD TO BE AN *******)
Username: codingforums
Password: donotchange
THIS IS NOT ADVERTISING, THIS IS TO MAKE AN ACCOUNT TO SEE IF IT WORKS.
Edit $username and $password to check after.
If I put legit information into the $username and $password it says Invalid.
But if i put fake information into $username and $password it also says invalid, which is correct.
PHP Code:
<?php
$username = "username";
$password = "password";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://weblogin.runescape.com/login.ws");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "username=".$username."&password=".$password."&dest=title.ws&mod=www&ssl=0");
$pagedata = curl_exec($ch);
curl_close($ch);
if (preg_match("/Your login was successful. You will shortly be redirected to your destination./i", $pagedata)) {
$valid = "Valid";
} elseif (preg_match("/Login Failed - Invalid Username or Password/i", $pagedata)) {
$valid = "Invalid";
} else {
$valid = "Cannot check! Too many invalid logins";
}
echo $valid;
?>
Does anyone notice the problem?