Jump to content
xisto Community
Sign in to follow this  
iGuest

PHP not workingsome one help me plz!

Recommended Posts

Hi all I am trying to make a login script and its not working! heres the current script I have:

<?phpinclude 'guestbook/includes/connect.php';?><form action="<?php $_SERVER['PHP_SELF']; ?>" method="POST"><table align="center" border="0">  <tr>    <th>Username:</th>	<th><input type="text" name="username"></th>  </tr>  <tr>    <th>Password:</th>	<th><input type="password" name="password"></th>  </tr>  <tr>    <th colspan="2" align="right"><input type="submit" value="Login"></th>  </tr></table></form><?$username = $_POST['username'];$password = $_POST['password'];$sql = @mysql_query("SELECT password, username FROM members");if (!$sql) {    exit("<p>n  <b>Error performing query:</b><br>n" . mysql_error() . "n</p>"); } elseif('username' == $username AND 'password' == $password) {   include 'phpinfo.php'; } ?>

When I tyep my password and username correctly in the login boxes and press submit and if they are correct it'll show the phpinfo.php page but it keeps refreshing to login.php!

Thanx for your help! Aslo I don't want to have a secure login ok. Thanx

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.