Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.42 KB | None | 0 0
  1. <?php
  2. $user = $_POST["username"];
  3. $passw = $_POST["password"];
  4. $pass = md5($passw);
  5. if( ($user == "K. Mirlor" AND $pass == "c02fee0c79e128dd53764a2e9fcb7ac6")
  6.                 OR
  7.     ($user == "T. Fox" AND $pass == "202cb962ac59075b964b07152d234b70")
  8.                 OR
  9.     ($user == "Test" AND $pass == "098f6bcd4621d373cade4e832627b4f6")   )
  10.     {
  11.     echo '
  12.     <form action="entered_data.php" method="post">
  13.         <table border="0" cellpadding="0" cellspacing="4">
  14.             <tr>
  15.                 <td align="right">Day:</td>
  16.                 <td><input type="Text" name="DD" size="2"><br></td>
  17.             </tr>
  18.             <tr>
  19.                 <td align="right">Month:</td>
  20.                 <td><input type="Text" name="MM" size="2"><br></td>
  21.             </tr>
  22.             <tr>
  23.                 <td align="right">Year:</td>
  24.                 <td><input type="Text" name="YY" size="2"><br></td>
  25.             </tr>
  26.             <tr>
  27.                 <td align="right">Officer:<br></td>
  28.                 <td><input type="Text" name="officer"><br></td>
  29.             </tr>
  30.             <tr>
  31.                 <td align="right">Taken action:<br></td>
  32.                 <td><input type="Text" name="action"><br></td>
  33.             </tr>
  34.             <tr>
  35.                 <td align="right">(Reason):<br></td>
  36.                 <td><input type="Text" name="reason"><br></td>
  37.             </tr>
  38.             <tr>
  39.                 <td align="right">Action taken by:<br></td>
  40.                 <td><input type="Text" name="by"><br></td>
  41.             </tr>
  42.             <tr>
  43.                 <td align="right">Additional comments:<br></td>
  44.                 <td><input type="Text" name="cmnt"><br></td>
  45.             </tr>
  46.             <tr>
  47.                 <td></td>
  48.                 <td align="center"><input type="Submit" value="Submit"><br></td>
  49.             </tr>
  50.         </table>
  51.     </form>';
  52.    
  53. // this counter stuff was just practising how to access files and edit them.
  54.     $counter = fopen("countersuccess.txt","r+");
  55.     $counteramount = fgets($counter, 10);
  56.     if($counteramount == "")
  57.         {
  58.         $counteramount = 0;
  59.         }
  60.     $counteramount++;
  61.     rewind($counter);
  62.     fwrite($counter, $counteramount);
  63.     fclose($counter);
  64.     echo "<br><br><br><a href=counterstats.php>Visit the stats.</a>";
  65.     }
  66. else if($user == "" OR $pass == "")
  67.     {
  68.     echo "You didn't fill out every textbox.";
  69.     $counter = fopen("counterfail.txt","r+");
  70.     $counteramount = fgets($counter, 10);
  71.     if($counteramount == "")
  72.         {
  73.         $counteramount = 0;
  74.         }
  75.     $counteramount++;
  76.     rewind($counter);
  77.     fwrite($counter, $counteramount);
  78.     fclose($counter);
  79.     }
  80. else
  81.     {
  82.     echo "Login failed.";
  83.     $counter = fopen("counterfail.txt","r+");
  84.     $counteramount = fgets($counter, 10);
  85.     if($counteramount == "")
  86.         {
  87.         $counteramount = 0;
  88.         }
  89.     $counteramount++;
  90.     rewind($counter);
  91.     fwrite($counter, $counteramount);
  92.     fclose($counter);
  93.     }
  94.  
  95. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement