Hi Guys,
How can i pass the value from the field member_id from the admin table to the resinet.php page via the header.
Here is the script:
<?
session_start();
if ($userid && $password)
{
// if the user has just tried to log in
$db_conn = mysql_connect('localhost', '', '');
mysql_select_db("resinet", $db_conn);
$query = "SELECT * FROM admin WHERE login_name='$userid' AND password='$password'";
$result = mysql_query($query, $db_conn);
if (mysql_num_rows($result) >0 )
{
// if they are in the database register the user id
$user = mysql_fetch_array($result);
session_register("valid_user");
$valid_user = $user["member_id"];
}
}
if (session_is_registered("valid_user"))
{
// logged in successfully to membership area
header ("Location: resinet.php?id= $member_id ");
}
else
{
if (isset($userid))
{
// if they've tried and failed to log in
header ("Location: warning.php ");
}
else
{
// they have not tried to log in yet or have logged out
header ("Location: warning.php ");
}
}
?>
It successfully goes to resinet.php but the member_id value is blank.
Any ideas how to pass the correct value from the field?
Cheers,
maccam