This is the code.
Its being used in conjunction with the UGS Framework.PHP Code:
function neologin($Username, $Password)
{
// Basic check
if($Username == null || $Password == null)
{
print "ERROR: Your must enter a username or password.\n";
return false;
}
// Navigate to neopets
$html = $this->httpClient->HTTPRequest('GET', 'http://www.neopets.com/loginpage.phtml', null, array());
$postData1 = 'destination=%2Findex.phtml&username='.$Username. '&x=0&y=0';
$html = $this->httpClient->HTTPRequest('POST', 'http://www.neopets.com/hi.phtml', $postData1, array("Referer" => "http://www.neopets.com/loginpage.phtml"));
$postdata2 = 'destination=%2Findex.phtml&username='.$Username.'&password='.$Password.'&x=0&y=0';
$html = $this->httpClient->HTTPRequest('POST','http://www.neopets.com/login.phtml?',$postdata2,array('Referer' => 'http://www.neopets.com/hi.phtml'));
// Return
//return (strpos($html, 'Logout') <> 0) ? true : false;
return($pos = strrpos($html, "Logout") <> 0) ? true : false;
}
But everytime I log in, with correct details, it wont return the details as valid. Always invalid.
Wondering if anyone can help me.
Nobody is on MSN so i cant ask them.
Thanks
Results 1 to 2 of 2
Thread: [PHP] Neopets Login Help
- 03 Apr. 2010 05:57pm #1
[PHP] Neopets Login Help
Shh, I'm watching My little pony.
- 03 Apr. 2010 08:10pm #2
Just checked the first lines.
Instead of using null, do this:
PHP Code:<?php
function neologin($username = false, $password = false) // sets them to false if the user doesn't specify what they are
{
if (is_string($username) && is_string($password)) // ignore arrays and especially boolean
{
// etc
}
}