Advertisement
Guest User

Untitled

a guest
Jul 26th, 2015
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.21 KB | None | 0 0
  1. <?php
  2. ini_set("session.cookie_httponly", "True"); <<<< Enable HttpOnly.
  3. session_start();
  4. session_regenerate_id();
  5. if(!isset($_SESSION['admin_loggedin']))
  6. {
  7.     header('Location: index.php');
  8. }
  9. if(isset($_GET['search']))
  10. {
  11.     if(!empty($_GET['search']))
  12.     {
  13.         $text = $_GET['search'];
  14.     }
  15.     else
  16.     {
  17.         $text = "No text Entered";
  18.     }
  19. }
  20. ?>
  21. <!DOCTYPE html>
  22. <html>
  23.     <head>
  24.         <meta charset="UTF-8">
  25.         <title>Admin Home</title>
  26.         <link rel="stylesheet" href="styles.css">
  27.     </head>
  28.     <body>
  29.  
  30.         <div id="home"><center>
  31.         </br><legend><text id=text><text id="text2">Welcome to Dashboard...</text></br></br> You are logged in as: <?php echo $_SESSION['admin_loggedin']; ?> <a href="logout.php">[logout]</a></text></legend></br>
  32.         <form action="" method="GET">
  33.             <div id="search">
  34.             <text id="text">Search Values</text><input type="text" name="search" id="textbox"></br></br>
  35.  
  36.             <input type="submit" value="Search" name="Search" id="but"/>
  37.  
  38.             <div id="error"><text id="text2">You Entered:</text><?php echo $text; ?></div>
  39.  
  40.             </div>
  41.         </form></center>
  42.     </div>
  43.  
  44.     </body>
  45. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement