Reply to Session/Variable

Your name:

Reply:


Posted by MD on 10/10/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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация