Hello !

0



assignment08b.php:
<?php    
    session_start
();    
    echo 
"Hello " $_SESSION["user"] . "!";
    echo 
"<br /><br />";
?>

<?php
    
if( !isset($_COOKIE['Username']) ) {
        
// no valid cookie found
    
}
    else {
        echo 
"The username retrieved from the cookie is: ";
        echo 
$_COOKIE['Username'];
        echo 
"<br /><br />";
    }    
?>

<?php    
    $_COOKIE
['Counter'] = ((isset($_COOKIE['Counter'])) ? $_COOKIE['Counter'] : 0);
    if(isset(
$_GET['add'])){
         
$_COOKIE['Counter']++;
    }
?>

    <form method="get">
    <input type="submit" name="add" value="Increment Cookie" />
    </form>
    
<?php
    
echo $_COOKIE['Counter'];
?>


<?php
    
echo "<br /><br /><br /><br />";
    echo 
"<strong>assignment08b.php:</strong>";
    echo 
"<br />";
    
show_source("assignment08b.php")
?>