PHP/Cookie Session/Session Variables Modify

Материал из Web эксперт
Перейти к: навигация, поиск

Modifying Session Variables

   <source lang="html4strict">

<?php

 session_start();
 session_register("access_count");
 $access_count++;
 
 if ($access_count==1) {
   echo "the first time!";
 } else {
   $message="accessed this page $access_count times.";
 }

?>

 <html>
 <head>
 <title>Access Count</title>
 </head>
 <body>
 <?php  echo "$message"; ?>
 </body>
 </html>
          
      </source>