Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

login with sessions php 4.1.2

Status
Not open for further replies.

olegkot

Programmer
Aug 28, 2001
31
IL
Hi! Pls help with sessions staff.

I'm trying to send my users to login ones in a session when they come for the first time to page play.php. But it does not work. Any ideas as well as solutions. Thx in advance.

There are 3 php pages:
1. play.php
--------------------------------
if (session_is_registered("valid_user")) {
...
code for play
} else {
header("Location: }
--------------------------------
2. login.php POSTs username and password to check.php
3. check.php
--------------------------------
if ($user && $password) {
... check DB code
if (mysql_num_rows($result) > 0 ) {
if (!session_is_registered("valid_user")) {
$valid_user = $user;
session_register("valid_user");
}
header("Location: } else {
header("Location: }
} else {
header("Location: }
-----------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top