Jump to content

Curl or script not working.


Russia

Recommended Posts

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 ASSHOLE)

 

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
$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?

 

Link to comment
Share on other sites

dude, take your username and password down, pronto .. not to rip into the integrity of anybody on this board, but you just never know.  better to give out that kind of information (if at all), via private message or email, etc.

 

EDIT: 'cause just writing, "DO NOT CHANGE THE PASSWORD TO BE AN ASSHOLE", is not enough to stop somebody from, well, changing your password.

Link to comment
Share on other sites

Nahh its okay its a brand new account, not even started tutorial island. Theres nothing on it basicly, and if someone does take it I can just recover with email address.

 

Or you can make your own account.

 

Also, can u see the problem? or an error in the coding?

Link to comment
Share on other sites

<?php
#credentials;
$username = 'codingforums';
$password = 'donotchange';

#full URL;
$feedUrl = 'https://weblogin.runescape.com/login.ws?username='.$username.'&password='.$password.'&dest=title.ws&mod=www&ssl=0';

#clear feed content var;
$feedContent = '';

#initiate cURL function;
$curl = curl_init();

#cURL options;
curl_setopt($curl, CURLOPT_URL, $feedUrl);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_TIMEOUT, 30 );
curl_setopt($curl, CURL_HTTP_VERSION_1_1, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_ENCODING, "gzip, deflate");
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);

#execute connection;
$feedContent = curl_exec ($curl);

#close connection;
curl_close ($curl);

if ($feedContent) { echo 'goodToGo'; } else { echo 'no good'; }
?>

 

this works for me.

Link to comment
Share on other sites

You have been blocked from logging in, because too many requests have been made from your IP in a short space of time.

 

Please try again in a few minutes.

 

they zapped me, so you're gonna have to test.

 

forgot your scraping preg_match() function .. also overlooked something .. changed out:

 

curl_setopt($curl, CURLOPT_POST, 1);

 

and replaced with:

 

curl_setopt($curl, CURLOPT_GET, 1);

 

try this code:

 

<?php
#credentials;
$username = 'codingforums';
$password = 'donotchange';

#full URL;
$feedUrl = 'https://weblogin.runescape.com/login.ws?username='.$username.'&password='.$password.'&dest=title.ws&mod=www&ssl=0';

#clear feed content var;
$feedContent = '';

#initiate cURL;
$curl = curl_init();

#cURL options;
curl_setopt($curl, CURLOPT_URL, $feedUrl);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_TIMEOUT, 30 );
curl_setopt($curl, CURL_HTTP_VERSION_1_1, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_GET, 1);
curl_setopt($curl, CURLOPT_ENCODING, "gzip, deflate");
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);

#execute connection;
$feedContent = curl_exec ($curl);

#close connection;
curl_close ($curl);

if ($feedContent)
{
if (preg_match ("/Your login was successful. You will shortly be redirected to your destination./i", $feedContent))
{ $valid = 'Valid'; }
elseif (preg_match ("/Login Failed - Invalid Username or Password/i", $feedContent))
{ $valid = 'Invalid'; }
else { $valid = 'Cannot check! Too many invalid logins'; }

echo $valid;
}
else
{ echo 'no connection'; }

 

EDIT: no need to bump .. it's not like topic is on the fifth page or something.

Link to comment
Share on other sites

was able to stop their script and see that POST is used and not GET;

 

here is working script:

 

<?php
#credentials;
$username = 'codingforums';
$password = 'donotchange';

#full URL;
$feedUrl = 'https://weblogin.runescape.com/login.ws';

#clear feed content var;
$feedContent = '';

#initiate cURL instance;
$curl = curl_init();

#cURL options;
curl_setopt($curl, CURLOPT_URL, $feedUrl);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_TIMEOUT, 30 );
curl_setopt($curl, CURL_HTTP_VERSION_1_1, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, 'username='.$username.'&password='.$password.'&dest=title.ws&mod=www&ssl=0');
curl_setopt($curl, CURLOPT_ENCODING, "gzip, deflate");
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);

#execute connection;
$feedContent = curl_exec ($curl);

#close connection;
curl_close ($curl);

if ($feedContent)
{
if (preg_match ("/Your login was successful. You will shortly be redirected to your destination./i", $feedContent))
{ $valid = 'Valid'; }
elseif (preg_match ("/Login Failed - Invalid Username or Password/i", $feedContent))
{ $valid = 'Invalid'; }
else { $valid = 'Cannot check! Too many invalid logins'; }

echo $valid;
}
else
{ echo 'no connection'; }
?>

Link to comment
Share on other sites

your script would break and you would receive a Fatal error if cURL was not installed on the server.

 

you can create file, call it phpinfo.php, and place the following code in it:

 

<?php
phpinfo();
?>

 

save it, and upload it to your server.  then, using your browser's 'Find' function, type in cURL support .. beside it you will see either enabled or disabled.

 

delete phpinfo.php from server.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.