Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- if (isset($_POST['submit'])) :
- $user = $_POST['aname'];
- $pword = $_POST['apass'];
- $pass = md5($pword);
- $usr = "select * from users where uname = '$user' and upass = '$pass'";
- $usr_result = mysql_query($usr) or die (mysql_error());
- $usr_row = mysql_fetch_assoc($usr_result) or die (mysql_error());
- if ($usr_result) :
- if (mysql_num_rows($usr_result) > 0) :
- if ($user && $pword == true) :
- session_regenerate_id();
- $_SESSION['USR_ID'] = $usr_row['uid'];
- session_write_close();
- header("location:/admin/index.php");
- exit;
- endif;
- endif;
- endif;
- endif;
- ?>
- <form name="login" id="login" action="<?$_SERVER['PHP_SELF']?>" method="post" onload="setFocus">
- <label class="left cboth">Användarnamn</label>
- <input class="left cboth" type="text" name="aname" id="aname" onfocus="formInUse" />
- <label class="left cboth">Lösenord</label>
- <input class="left cboth" type="password" name="apass" id="apass" onfocus="formInUse" />
- <input class="left cboth" type="submit" name="submit" id="submit" value="Logga in" />
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement