Implement the SESSION function in PHP3 (3 ). Example: test_session.php3? Phprequire (session. inc. php3); require (cookie. inc. php3 );?? Phpsession_checkid (20); if the session becomes invalid after 20 minutes, you need to set the mysql connection example program: test_session.php3.
Require ("cookie. inc. php3 ");
?>
Session_checkid (20); // after 20 minutes, the session becomes invalid.
// Set the mysql connection parameters below
Mysql_connect ('localhost', 'user', 'pass') or Die ("can't connect to db! ");
?>
Session/Cookie-test
This Page shocould show how to handle the "session. inc. php3" library
We will use a mask with a record showing routine
If ($ show ){
If (session_read ()){
$ Username = $ session [username];
$ Userpass = $ session [userpass];
Echo"
Session [username]: $ username
Session [userpass]: $ userpass ";
}
}
Else {
$ Session [username] = "yourid ";
$ Session [userpass] = "12345 ";
If (! Session_write ()){
Print $ sess_error;
} Else {
Echo"
Session [username] is set to $ session [username]
";
Echo "session [userpass] is set to: $ session [userpass]
";
Echo "test the role of the SESSION ";
}
}
?>
Original Author: unknown
Why? Php require (session. inc. php3); require (cookie. inc. php3 );? ? Php session_checkid (20); // after 20 minutes, the session becomes invalid. // you need to set up mysql connection...