I am experiencing very difficult (hard to find) problem with my PHP login script. I am using sessions to make login work with standard send form and using this script:
public function login($user, $password)
if (!empty($user) && !empty($password))
{
$user = $web->esc($user);
$password = $web->Hash($user, $password);
$db->selectDb('login');
$qw = mysql_query("SELECT * FROM account WHERE username='".$user."' AND pass='".$password."'");
if (mysql_num_rows($qw) > 0)
{
$result = mysql_fetch_array($qw);
$_SESSION['user_name'] = $result['username'];
$_SESSION['user_id'] = $result['id'];
return true;
...
...
And in login I am using something like this:
if(isset($_POST["send"]))
{
if($auth->login($_POST["name"], $_POST["pass"]))
{
header("location: ./");
}
}
else
...
...
It is working quite ok but in Opera and sometimes other browsers there is a problem. When I log in in Opera, Google Chrome etc for example – fill in my form and send it – it just “stucks” on login form and never let me see my page after login – it is working in other browsers – I just do not see the problem why in some browsers it is not wokring. DO you have any idea how to fix this? Thank you.
OK problem solved after having these errors:
In settings in php.ini changing this:
Everything works fine thx to Mihai Stancu for error analysis code.