RyanCain97 Posted September 2, 2014 Share Posted September 2, 2014 Hello i am trying to make the admin login in a webpage and after I completed the page i uploaded it and now the page is not loading Here is the script <?php error_reporting(E_ALL); ini_set('display_errors', '1'); exit(); ?> <?php session_start(); if (!isset($_SESSION["manager"])){ header("location:admin_login.php"); exit(); } exit(); ?> <?php if(isset($_POST["username"])&&isset($_POST["password"])){ $manager=preg_replace('#[^A-Za-z0-9]#i','',$_POST["username"]); $password=preg_replace('#[^A-Za-z0-9]#i','',$_POST["password"]); include"../storescripts/connect_to_mysql.php"; $sql=mysql_querey("SELECT id FROM admin WHERE username='$manager' AND password='$password' LIMIT 1"); if($existCount == 1){ while($row = mysql_fetch_array($sql)){ $id = $rpw["id"]; } $_SESSION["id"] = $id; $_SESSION["manager"] = $manager; $_SESSION["password"] = $password; header("location:index.php"); exit(); } else { echo 'That Information is incorrect, try again <a href="index.php">Click Here</a>'; exit(); } } ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Admin Login</title> <link rel="stylesheet" href="k../style/style.css" type="text/css" media=="screen" /> <script type="text/javascript" src="//use.typekit.net/jxp6vds.js"></script> <script type="text/javascript">try{Typekit.load();}catch(e){}</script> </head> <body> <div align="centre" id="mainWrapper"> <?php include_once("../template_header.php") ?> <div id="pageConntent"> <h2>Please Log In To Manage The store</h2> <form id="form1" name="form1" meathod="post" action="admin_login.php"> Username:<br/> <input name="username" type="text" id="username" size="40"/> <br/><br/> Password<br/> <input name="password" type="password" id="password" size="40"/> <br/> <br/> <br/> <input type="submit" name="button" id="button" value="Log In" /> </form> </div> <?php include_once("../footer.php"); ?> </div> </body> </html> Thank you in advance Quote Link to comment Share on other sites More sharing options...
mikosiko Posted September 2, 2014 Share Posted September 2, 2014 (edited) well... you have an exit() just in the third line... what do you expect? and then another few lines below... Edited September 2, 2014 by mikosiko Quote Link to comment Share on other sites More sharing options...
Ch0cu3r Posted September 2, 2014 Share Posted September 2, 2014 (edited) Look at lines 4 and 12... gives you a clue. Also why are you going in and out of php mode on lines 5 and 6 and 13 and 14? This is pointless if you are not going to output anything between closing and opening php tags. Edited September 2, 2014 by Ch0cu3r Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted September 2, 2014 Share Posted September 2, 2014 What are you doing there, RyanCain97? You store the password as plaintext? And then you put it into the session so that all precious passwords end up in unprotected files in the temporary folder? And then you restrict the password to alphanumerics? And this is all for the admin accounts? WTF? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.