File: fwphp/glomodul/z_examples/book_video/03steinmetz_2008/ch08_User_and_Ses_Tracking/sessionview.php

Recommend this page to a friend!
  Classes of Slavko Srakocic  >  B12 PHP FW  >  fwphp/glomodul/z_examples/book_video/03steinmetz_2008/ch08_User_and_Ses_Tracking/sessionview.php  >  Download  
File: fwphp/glomodul/z_examples/book_video/03steinmetz_2008/ch08_User_and_Ses_Tracking/sessionview.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change:
Date: 2 months ago
Size: 569 bytes
 

Contents

Class file image Download
<?php

session_start
();

if (
$_REQUEST["name"]) {
   
$_SESSION["name"] = $_REQUEST["name"];
}
if (
$_REQUEST["color"]) {
   
$_SESSION["color"] = $_REQUEST["color"];
}

if (
$_REQUEST["clear"]) {
    unset(
$_SESSION["name"]);
    unset(
$_SESSION["color"]);
}

$name = $_SESSION["name"];
$color = $_SESSION["color"];

if (
$name) {
    print
"Your name is <b>$name</b>.<br />";
}
if (
$color) {
    print
"Your favorite color is <b>$color</b>.<br />";
}
print
'<a href="sessionform.php">Edit details</a>';
print
' | <a href="sessionview.php?clear=1">Clear values</a>';

?>

For more information send a message to info at phpclasses dot org.