Reply to newbie session question

Your name:

Reply:


Posted by Morlaath on 08/20/07 00:14

Ok I have a login page that forwards to a php page (loginCheck.php)
which connects to the db verifies the user blah blah. If the user is
not verified the function verifyUser($un, $pw) returns -1, otherwise
0. Also if the user/pass is in the db (user is verified), then session
variables are set e.g. $_SESSION['username'], etc. I save the returned
value from verifyUser and have a check that redirects to the main page
or back to the login page, (success, failure respectively).

this is how I am doing this.

$verified = verifyUser($_POST['user'], $_POST['pass']);

if($verified == 0) {
header("Location: ../index.php");
} else {
header("Location: login.php");
}

pretty simple.......except if the user/pass is good and you are
redirected to the index page all the session variables are gone, as if
the session was destroyed. This sucks because I have a header at the
top of the page which tells you whether you are logged in or not, etc.
But instead I get an error "Undefined variable: _SESSION....". Any
help with this would be greatly appreciated.

[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

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