File: fwphp/glomodul/z_examples/book_video/03steinmetz_2008/ch08_User_and_Ses_Tracking/userstore.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/userstore.php  >  Download  
File: fwphp/glomodul/z_examples/book_video/03steinmetz_2008/ch08_User_and_Ses_Tracking/userstore.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: 1 month ago
Size: 433 bytes
 

Contents

Class file image Download
<?php
if (isset($_REQUEST["user_name"])) {
   
setcookie("stored_user_name", $_REQUEST["user_name"], time() + 604800, "/");
   
$_COOKIE["stored_user_name"] = $_REQUEST["user_name"];
}
if (isset(
$_COOKIE["stored_user_name"])) {
   
$user = $_COOKIE["stored_user_name"];
    print
"Welcome back, <b>$user</b>!";
} else {
   
?>
<form method="post">
    User name: <input type="text" name="user_name" />
    </form>
    <?php
}
?>

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