I am sorry for duplicating this in multiple catagories, but i am not sure which one is a good catagory to put this in
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");
?>
someone asked me how i get my $id and $password. simple, <input type="text" name="id"> and <input type="password" name="password">
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.
In the shortest term
this script works but when i type in the correct id and password, it says Wrong Password. if replace die with echo, it allow the person to the private page and says wrong password also.
Please help.. i've been trying to figure this out for hours. I do not want to download a tutorial or anything. I am trying this on my own and need advice/tips or help as you will. Even though i learned how to do this out of a book, now i'm trying this for my actual site.