Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

Storing a Session Variable using PHP in PHP

  1. <?php
  2. session_start();
  3. // store session data
  4. $_SESSION['views']=1;
  5. ?>
  6.  
  7. <html>
  8. <body>
  9.  
  10. <?php
  11. //retrieve session data
  12. echo "Pageviews=". $_SESSION['views'];
  13. ?>
  14.  
  15. </body>
  16. </html>
  17.