Advertisement
Guest User

Untitled

a guest
Oct 1st, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.19 KB | None | 0 0
  1. <?PHP
  2. session_start();
  3. if($_GET['l']){
  4.     session_destroy();
  5.     echo "<meta http-equiv='Refresh' content='0;index.php'>";
  6. }
  7. ?>
  8. <HTML>
  9. <HEAD>
  10. <script type="text/javascript" src="qrcode.js"></script>
  11. <script type="text/javascript" src="sample.js"></script>
  12. <LINK REL="stylesheet" HREF="style.css" TYPE="text/css">
  13. </HEAD>
  14. <BODY>
  15. <div id='menubar'>
  16.     <div id='menu'>
  17.     <a href='index.php'>Rings</a>
  18.     </div>
  19.     <div id='login'>
  20.     <?PHP   if(!isset($_SESSION['user'])){  ?>
  21.         <FORM method='POST' action='login.php'>
  22.             Username: <input type='text' name='name'>
  23.             Password: <input type='password' name='pass'>
  24.                       <input type='submit' name='submit' value='Log in'>
  25.         </FORM>
  26.     <?PHP   }else{echo"Logged in as {$_SESSION['user']}.<BR><a href='index.php?l=o'>Log out</a><BR>";} 
  27.    
  28.     if($_SESSION['cart']){
  29.         $s = count(explode('-',$_SESSION['cart'])) > 1 ? 's' : '';
  30.         echo "You have <a href='index.php?cat=cart'>". count(explode('-',$_SESSION['cart'])) . " item".$s." in your cart</a>";
  31.     }else{
  32.         echo "Your cart is currently empty";
  33.     }
  34.  
  35.  
  36.     ?>
  37.        
  38.     </div>
  39. </div>
  40.  
  41. <div id='content'>
  42. <?PHP
  43. $cat = (isset($_GET['cat'])) ? $_GET['cat'] : 'home';
  44. include($cat.".php");
  45. ?>
  46. </div>
  47.  
  48. </BODY>
  49. </HTML>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement