Yeah it worked, i just added it, and its running fine. I still can't get a drop down menu to work though. I have 2 tables. 1 with user_id, username, password. and 1 with user_id, options. I want users to login, if user1 logs in, it will build a menu based on the options specified for user1.
I have
<?
session_start();
?>
at the very top, and then..
$sUserID = $row["user_id"];
session_register("sUserID");
Maybe I should add something like this to the login function.
$query=mysql_query("SELECT user_id FROM table1 WHERE user_name='$user_name' AND password='$password'",$db) or die ("Cant run query");
while ($row=mysql_fetch_array($query))
{
if ($row["user_name"] == $user_name && $row["password"] == $password)
{
$sUserID = $row["user_id"];
session_register("sUserID");
}
}
If anyone else has any suggestion, please help.
Cheers
Ben