Author Topic: authQuery.php authentication failed  (Read 1656 times)

I'm trying to authenticate users using a PHP script. Up until recently, it was working fine. I did change web hosts recently, so that might be related.

Code: [Select]
function BlocklandAuthenticate($username)
{
$postdata = http_build_query(
array(
'NAME' => $username,
'IP' => $_SERVER['REMOTE_ADDR']
)
);
printf("%s\n", $postdata);
$opts = array('http' =>
array(
'method'  => 'POST',
'header'  => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context  = stream_context_create($opts);
$result = file_get_contents('http://auth.blockland.us/authQuery.php', false, $context);
printf("%s\n", "RESULT: " . $result);
return $result;
}

The correct data is sent to blockland.us, but $result is blank. Any ideas?

What are you making?

What are you making?
Basically a PHP script that authenticates users, since the Auth Query is also in php.

What are you making?

Just statistics for some mods. It hasn't been working since I changed hosts about a month ago.

Just statistics for some mods. It hasn't been working since I changed hosts about a month ago.

Do the name and IP of the user match up?

Do the name and IP of the user match up?

Yes. Everything seems to be in order. I'm suspecting a problem with the PHP config on the new server.

Got it. I had to add this line to my php.ini file:
Code: [Select]
allow_url_fopen = On