a pastebin project

Untitled

  1. <?php include('header.php'); ?>
  2.  
  3. <?php
  4. $chickens_are_real = "duck";
  5. $cows_are_real = "petrie";
  6. if(isset($_POST['submit'])) {
  7.    if($_POST['admin'] == $chickens_are_real && $_POST['password'] == $cows_are_real){
  8.  
  9. $admin = $_POST['admin'];
  10. $pass = $_POST['password'];
  11. session_start();
  12. $admin = addslashes($admin);
  13. $pass = addslashes($pass);
  14.  
  15. $_SESSION['admin'] = $admin;
  16.  
  17.  
  18. $_SESSION['password'] = $pass;
  19.  
  20.  
  21.    }
  22. }
  23. if($_POST['submit']){
  24.    if($_POST['admin'] == $chickens_are_real && $_POST['password'] == $cows_are_real){
  25.      
  26.          session_start();
  27. if(!isset($_SESSION['admin'])){
  28. echo 'You are not <a href="/admin_login.php">logged in</a>.';
  29. }
  30.  
  31.       echo "The login name and password were correct. You may now access the following Admin Areas:<br /><ul><li><a href=\"/news/index.php?action=addnews129\">Adding News</a></li></ul>More items will be added at a later time...";
  32.    }
  33.    
  34.    else{
  35.       echo "<center><h3>Error</h3></center>";
  36.       echo "<p>The login name or password was not correct.";
  37.    }
  38. }
  39. elseif($_GET['actn'] == "test"){
  40.   session_start();
  41.   $admin = $_SESSION['admin'];
  42.   $pass = $_SESSION['password'];
  43.    echo "$admin is your admin name.<br />\n";
  44.    echo "$pass is you password.";
  45. }
  46. else{
  47. ?>
  48. <center><h3>Admin Login</h3>
  49. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" />
  50.     Admin:<br />
  51.     <input type="text" name="admin" /><br />
  52.     Password:<br />
  53.     <input type="password" name="password" /><br />
  54.    <input type="submit" value=" Submit  " name="submit" />
  55.    <input type="hidden" value="submit" name="submit" />
  56. </form>
  57. </center>
  58. <?php
  59. }
  60. ?>
  61.  
  62.  
  63.  
  64. <?php include('footer.php'); ?>

advertising

Create a Paste

Please enter your new post below (or upload a file instead):





Please note that information posted here will not expire by default. If you want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords.

worth-right