help
Posted: Tue Mar 02, 2004 7:09 pm
Hi all, I am new to PHP and this forum. I can't think of a good subject name therefore "help".
Here's what my problem is, I am taking over a project(un commented) from some one else. This project would run fine in a host server. But once I downloaded to my local machine. It doesn't work. Here's the piece of code that I am having problem with. The file name is welcome.php
When I entered in the correct user/pass, and click submit, the page doesn't do anything. Now notice the variable $login, I am curious that why doesn't it need to declare like $login = $_GET["login"]? Note that this is working in a host server, and if I do $login = $_GET["login"], it will go into the if() block, but it won't send me to another page unless I add something like echo "blah blah"; before the header("Location:..") call.
Any suggestions will be much appreciated as I am stuck on this for couple hours now.
Here's what my problem is, I am taking over a project(un commented) from some one else. This project would run fine in a host server. But once I downloaded to my local machine. It doesn't work. Here's the piece of code that I am having problem with. The file name is welcome.php
Code: Select all
<?
if($login == "yes"){
//do something...
//some SQL statement to verify user.
header("Location: ?welcome=user");
}
...
...
?>
<form method="post" action="welcome.php?login=yes">
username:
<br><input type="text" name="username" size="15">
<br>password:
<br><input type="password" name="password" size="15">
<br><input type="submit" value="login">
</form>Any suggestions will be much appreciated as I am stuck on this for couple hours now.