Jump to content

Parse error


Kyza

Recommended Posts

Hey, im curretly working on a admin page, I have done this code:

<?php//session start and get variablesession_start();$user = $_SESSION['user'];//connect$connect = mysql_connect("localhost" , "root" ,"");mysql_select_db("netbb");//query$get = mysql_query("SELECT * FROM users WHERE username='$users'")while ($row = mysql_fetch_assoc($get)){ $admin = $row['admin'];}echo $admindie();?>

I keep getting this error

Parse error: parse error in C:\wamp\www\web\admin.php on line 13

Can someone please help.

Link to comment
Share on other sites

And $users is not defined, $user is.Also good option is to store hashed id, email, password to cookie or session.Then u can do:$session = $_SESSION['user'];$session = explode(":", $session);and if your session is formed like this:ID:email@dom.com:password$session[0] will be ID$session[1] is emailand$session[2] is passwordAll of those, ID, email, password are hashed and writen with :$id = md5('ID');$email = md5('email');$pass = md5('pass');and $id:$email:$pass

Link to comment
Share on other sites

Also good option is to store hashed id, email, password to cookie or session.
storing password in session i think it is not a good idea..and i think it dont need to store it in session..
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...