Hi all,
This is the top part of my script:<?
session_start();
if ($userid && $password)
{
// if the user has just tried to log in
$db_conn = mysql_connect('localhost', '', '');
mysql_select_db("psp", $db_conn);
$query = "SELECT * FROM members WHERE login_name='$userid' AND password='$password' AND admin='no'";
$result = mysql_query($query, $db_conn);
if (mysql_num_rows($result) >0 )
{
// if they are in the database register the user id
$valid_user = $userid;
session_register("valid_user");
}
}
if (session_is_registered("valid_user"))
{
// logged in successfully to membership area
header ("Location: index.php?id=3 ");
}
You will notice that if i put the value 3 in the above script it works fine. What i want to do is get the value associated with that persons username and password from the member_id field from the database. What would i need to add to the above script?
Cheers,
Colin Howell