Example program: TEST_SESSION.PHP3
Require ("cookie.inc.php3");
?>
Session_checkid (20); Session expires in 20 minutes.
Below you need to set the MySQL connection parameters
mysql_connect (' localhost ', ' user ', ' pass ') or Die ("can ' t connect to db!");
?>
<title>session/cookie-Test</title>
This page should show how to handle the "SESSION.INC.PHP3" library
We'll 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 function of the session";
}
}
?>
Original Author: unknown
The above describes the function of Symantec endpoint protection to implement the session in PHP3 (iii), including the content of Symantec endpoint Protection, hoping to help friends interested in PHP tutorials.