midriss Posted November 12, 2007 Share Posted November 12, 2007 PLEASE HELP ME I am a newbie creating an a cms for a website. I have created the other sectond for adding contents and puting contents ito categories. however its the security as[pect thats giving me headache. The login page seen below does not work. i cant get to the welcome.php. when I put the correct user name and password. i only get to the failed .php page. please help me with this <?php require_once("../includes/Sentry.php"); $sentry = new Sentry(); if ($HTTP_POST_VARS['user'] != ''){ $sentry->checkLogin($HTTP_POST_VARS['user'],$HTTP_POST_VARS['pass'],4,'welcome.php','failed.php'); } if ($HTTP_GET_VARS['action'] == 'logout'){ if ($sentry->logout()){ echo '<center>You have been logged out</center><br>'; } } ?> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <table width="25%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000066"> <tr> <td align="center" bgcolor="#000066"><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Login</strong></font></td> </tr> <tr> <td bordercolor="#FFFFFF"><form name="form1" method="post" action="login.php"> <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><br> User: <input type="text" name="user"> </font></p> <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> Pass: <input type="password" name="pass"> </font></p> <p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> <input type="submit" name="Submit2" value="Submit"> </font></p> </form> <div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="login.php?action=logout">Logout</a> </font></div> </td> </tr> </table> </body> </html> Quote Link to comment Share on other sites More sharing options...
drakal30 Posted November 13, 2007 Share Posted November 13, 2007 well I think I see an issue right off the mark if ($HTTP_GET_VARS['action'] == 'logout'){ if ($sentry->logout()){ echo '<center>You have been logged out</center> ';<-- Does this need to be here, if not it will cause the php compiler to error out. } } 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.