01-29-2008, 02:12 PM
|
#1 (permalink)
|
|
Super Moderator
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
|
made a login for admin (need help)
hello, as i am learning php i just work out of my ass sort of speek
so this is one try so please dont flame me or so on, and try to be as clear about the things you explain to me thank you.
PHP Code:
<?php include 'config.php';
if(@$_POST['submit']=="log") $ert = mysql_query("SELECT * FROM `cms` WHERE `username`,`password`, `rank` = '0'"); while ($row = mysql_fetch_array($ert, MYSQL_NUM)) { if($username == $row['username'] && $md5password == $row['password']){ $_SESSION['loggedIn'] = true;
// check the rank if $_session['loggedIn'] == true; print "admin pannel open"; elseif $_SESSION['loggedIn'] == null; print "Accses Denied";
if $ert = "0"; print "Accses Denied"; elseif $ert = "1"; print "you have accses to admin";
<h2>Please log in:</h2> <form method="post" action="<?php echo $PHP_SELF;?>"> Username: <input name="usernamn" type="text" value="" /><br /> Password: <input name="password" type="password" value="" /> <input name="submit" type="submit" value="log" />
?>
The Question is, what have i done wrong?
and what should i fix.
ps, NO FLAME! please.
ty
Quote:
ps i know i havent defined the Varibals in Mysql,
for username and password but i dont remember how to do it i fix it later :P
|
Last edited by codefreek : 01-29-2008 at 02:41 PM.
Reason: EDIT CODE! - 3
|
|
|
|