I have my own web server on this pc (windows xp home edition and works fine).. i'm working on transfering it to a different pc, but until i get that.. i'm doing all my stuff on here..
I am running the Latest Version of Apache, PHP5, MySQL5 and the latest version of phpMyAdmin.
I'm currently in the process in building a simple login system for my site but secure using sessions and when i created it.. it got the data from the database but when i typed the user info correctly and clicked Login.. It said Wrong Password.
my login.php page is just like any other login page.. it asks for a id and password then transfers the data from the form to process-login.php
This is the Script i have for the process-login.php page
<?php
if (empty($password)) { die("No Password specified");}
if ((strlen($password) < 5) || (strlen($password) > 20)) { die("Password too long/short");}
include("include/header.php");
$query="SELECT id,password FROM pilot WHERE id='$id'";
$pilot=mysql_query($query) or die("Could not execute Query");
$row=mysql_fetch_row($pilot);
if(!(md5($password) == $row['password'])) {
die ("Wrong Password");
} else {
die("User does not exist");
}
?>
Welcome <?php echo $id; ?>
<?php
include("include/footer.php");
?>
Please help, i dont know what i did wrong if anything. I still have to add the session code but in the mean time.. i need this to work then i'll add the session_start commands.
this is basically my first time creating a login system, i dont want to use tutorials.. i used a book to learn about doing this but then i put the book away and re-did the code at my own way but similar to the book. the book i used was "Making use of PHP" by Ashok Appu. it has PHP/MySQL scripts in there and i pulled this one out of this book then deleted the script and customized it to my own liking. it works just displays the wrong password even though the username and password are correct.
my config.php.ini file is included in the header.php script, i basically made a simple php template using tables
Toby