Hi all,
Bit of a long one, apologies
I'm new to php 4 ( I know 5 is out but the server I must use is 4), last time I used PHP it was version 3. ( howold did I feel with 6 coming out)
I need to hold a varible until a logoff button is pressed, ( a username).
this used to work, when the world was young.
This is where the stuff is passed
<form method="GET" name="login" action="login.php">
Username:
<input type=text name="user"><br>
Password:
<input type=password name="pass"><ce>
<input type=submit value="Log In">
</form>
this what I use to check the logon script.
$logres=@mysql_num_rows(mysql_query("select * from pupils where name='$user' AND password='$pass'"));
print("$user, $pass");
if($logres>0)
{
print ("login correct<br>");
if($user=='admin')
{
print ("Please click <A href=admin.htm> here </a> to continue");
}
Else
{
print ("Please click <A href=index.htm> here </a> to continue");
}
session_register("user");
}
else
{
print ("incorrect logon<br>");
print ("Please click <A href=logon.php> here </a> to re-try");
}
?>
There is a header that contains the following
session_start();
$sesid=session_id();
I know its a lot of code, but things have changed lots!
Any help will be rewarded with cookies.
John