|
Posted by MD on 09/26/62 11:20
I recently setup a localhost testing server which was installed using WAMP5.
I have written several PHP scripts which work fine when I upload and test on
my web server, but I cannot get them to work on the localhost testing
server.
These are fairly simple scripts which use HTML forms and are processed
through PHP. They also use password logins and sessions. The localhost
seems to loose the session info.
I've searched for the answer to this in many places (books, web, etc.), but
cannot find anything referring to this problem.
Below is a partial listing - always fails to find the client - goes to If
statment: echo "Incorrect password for " . $upl['username']; even though the
username/password is correct.
$query = "SELECT * FROM tbl_client WHERE username = '" .
$_SESSION['username'] . "'";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
$upl = mysql_fetch_array($result);
if($upl['username'])
{
if($_SESSION['password'] != $upl['password'])
{
echo "Incorrect password for " . $upl['username'];
die();
}
}
else {
echo $upl['username'] . "was not found in our client list.";
echo "If you are a new client please use the assignment form.";
echo "We will issue a user name and password.";
die();
}
As I said these work fine when I upload and test on my web server, but not
on the local testing server.
I suspect the problem is related to a setting in php.ini (??), but have not
been able to figure it out.
Please help!
Mike
Navigation:
[Reply to this message]
|