Jump to content
MakeWebGames

Login problem


Recommended Posts

try to login but get this error:

Fatal error: Call to undefined method database::escape() in /home/damagedc/public_html/authenticate.php on line 52

This is the authenticate part:

<a href=login.php>> Back</a>");

}

else

{

$_SESSION['loggedin']=1;

$mem=$db->fetch_row($uq);

$_SESSION['userid']=$mem['userid'];

$IP = $db->escape($_SERVER['REMOTE_ADDR']);

$db->query("UPDATE users SET lastip_login='$IP',last_login=unix_timestamp() WHERE userid={$mem['userid']}");

if($set['validate_period'] == "login" && $set['validate_on'])

{

$db->query("UPDATE users SET verified=0 WHERE userid={$mem['userid']}");

}

header("Location: loggedin.php");

}

?>

Link to comment
Share on other sites

Thanks for that

That helped but now i got another problem with when i logon.

error:

Warning: Cannot modify header information - headers already sent by (output started at /home/damagedc/public_html/config.php:13) in /home/damagedc/public_html/authenticate.php on line 58

$db->query("UPDATE users SET verified=0 WHERE userid={$mem['userid']}");

}

header("Location: loggedin.php");

}

?>

Also a problem on the index header. But i dont see wat i have done wrong here.

Warning: mysql_query() [function.mysql-query]: Access denied for user 'damagedc'@'localhost' (using password: NO) in /home/damagedc/public_html/header.php on line 53

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/damagedc/public_html/header.php on line 53

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/damagedc/public_html/header.php on line 53

$location = mysql_fetch_assoc(mysql_query("SELECT cityname FROM cities WHERE cityid=".$ir['location'].""));

Edited by Damagedcity.com
Link to comment
Share on other sites

Your error is

Warning: mysql_query() [function.mysql-query]: Access denied for user 'damagedc'@'localhost' (using password: NO) in /home/damagedc/public_html/header.php on line 53

meaning in header.php on line 53 you should change it to $db-> instead of mysql... if it still gives you that error your database info is not right in your config.php

and lol @...

$location = mysql_fetch_assoc(mysql_query("SELECT cityname FROM cities WHERE cityid=".$ir['location'].""));

try :

$location = $db->query("SELECT cityname FROM cities WHERE cityid=".$ir['location']."");

Edited by lucky3809
Link to comment
Share on other sites

Thanks

i tried wat u said but i got this error:

Fatal error: Cannot use object of type mysqli_result as array in /home/damagedc/public_html/header.php on line 93

i tried fixing it myself and used this and it worked.

$location = $db->fetch_row($db->query("SELECT cityname FROM cities WHERE cityid=".$ir['location'].""));

Also i still have that login problem if anyone can help

Warning: Cannot modify header information - headers already sent by (output started at /home/damagedc/public_html/config.php:13) in /home/damagedc/public_html/authenticate.php on line 58

Link to comment
Share on other sites

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.   Paste as plain text instead

  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...