Jump to content

devangel

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

devangel's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. tried that: $data = mysql_query("SELECT * FROM users WHERE userid = '".$_SESSION['SESS_USERID']."'")) or die(mysql_error()); $usr = mysql_fetch_array( $data ); and got this parse error: Parse error: parse error in C:\wamp\www\hero\game\includes\config.php on line 43 which is clean function clean($str) { if (is_numeric($str)) $str=floor($str); $cleaned=strip_tags($str); $cleaned=htmlspecialchars($cleaned); $cleaned=mysql_real_escape_string($cleaned); $to_clean=array("%20", "\"", "'", "\\", "=", ";", ":"); <-- 43 $cleaned=str_replace($to_clean, "", $cleaned); return $cleaned; }
  2. my query doesnt look wrong $qry="SELECT * FROM users WHERE username='$username' AND password='".md5($_POST['password'])."' and authlevel>0"; $result=mysql_query($qry); it checks to see if your banned userlevel (0) but yeah i cant figure out why its saying its not defined i used: <?php if ($_SESSION['authlevel']>4) echo "adminpanel"; ?> and i got Notice: Undefined index: authlevel in on that line.
  3. how would i be able to save the authlevel in a session ive tried $user = mysql_fetch_assoc($result); $_SESSION['SESS_USERID'] = $user['userid']; $_SESSION['SESS_USERNAME'] = $user['username']; $_SESSION['SESS_AUTHLEVEL'] = $user['authlevel']; how would you define it into a session?
  4. hey guys, im making a check user level script. if $usr['authlevel']>4 echo "adminpanel" i have set my sessions. $_SESSION['SESS_USERID'] = $user['userid']; $_SESSION['SESS_USERNAME'] = $user['username']; how do i use the sess_userid to retrieve the users details for the users id only. ive tried :: mysql_query("SELECT * FROM users WHERE userid = '$userid'") or die(mysql_error()); $usr = mysql_fetch_array( $data ); please someone with guidance, ive been searching for hours. i need to make a if statement to check user level, but i havent managed to retrieve db info via session.
  5. never mind about that one guys, stuck on this: im trying to make an array to store all my users info so i can display it. $data = mysql_query("SELECT * FROM users where userid="$_SESSION['SESS_USERID']) or die(mysql_error()); $usr = mysql_fetch_array( $data ); this is my code so far. i can pull info from the database, but i edited it with "where userid=$_SESSION['SESS_USERID']}" to get the users id from my session. but it still doesn't work, this code is located in my config file so i can reference it onto other files.
  6. hey guys, i got this in an include file (leftbar) with the query in my config file. i try to run this little code but its not working, its suppose to show you an admin panel if it works . any help?
  7. Hey guys, How would i be able to display my users details on my website, i have registered but it only gets 2 values the id of the user and username. $_SESSION['SESS_USERID'] = $user['userid']; $_SESSION['SESS_USERNAME'] = $user['username']; instead i want to get all the information located in users. example: User Details: Username: Level: Gender: i wanna be able to get that info from my database and display it. can anybody help it would be greatly appreciated . and also, i want to add a little panel to my index for admins. i have a "authlevel" in users 0 = banner 1 = user 4 = admin on my page i wanna do a small code if user & user authlevel > 4 echo (panel) how would i be able to do that with my above problem, like im trying to do that function but its not working, it doesnt show
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.