<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/api_config.php');
error_reporting(E_ALL);
ini_set("display_errors", 1);
$loc = $_POST['u'];
$config = $config['production'];
$con = mysql_connect($config['db']['host'], $config['db']['username'], $config['db']['password']) or die ("Unable to connect");
mysql_select_db ($config['db']['dbname'], $con) or die ("Unable to select database");
$query = "SELECT `location` FROM `active_users` WHERE name = '$loc'";
$result = mysql_query($query, $con) or die ("Unable to run query");
if (mysql_num_rows($result) > 0) {
header("HTTP/1.0 200 Success");
header('Content-Type: text/plain');
} else
header("HTTP/1.0 404 Not Found");
header('Content-Type: text/plain');
}
mysql_close($con);
?>
I get an error HTTP Error 500 (Internal Server Error):in my browser. What for?
source
share