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: }
-----------------------------------------------------------------------------
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: }
-----------------------------------------------------------------------------