Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $user = $_POST["username"];
- $passw = $_POST["password"];
- $pass = md5($passw);
- if( ($user == "K. Mirlor" AND $pass == "c02fee0c79e128dd53764a2e9fcb7ac6")
- OR
- ($user == "T. Fox" AND $pass == "202cb962ac59075b964b07152d234b70")
- OR
- ($user == "Test" AND $pass == "098f6bcd4621d373cade4e832627b4f6") )
- {
- echo '
- <form action="entered_data.php" method="post">
- <table border="0" cellpadding="0" cellspacing="4">
- <tr>
- <td align="right">Day:</td>
- <td><input type="Text" name="DD" size="2"><br></td>
- </tr>
- <tr>
- <td align="right">Month:</td>
- <td><input type="Text" name="MM" size="2"><br></td>
- </tr>
- <tr>
- <td align="right">Year:</td>
- <td><input type="Text" name="YY" size="2"><br></td>
- </tr>
- <tr>
- <td align="right">Officer:<br></td>
- <td><input type="Text" name="officer"><br></td>
- </tr>
- <tr>
- <td align="right">Taken action:<br></td>
- <td><input type="Text" name="action"><br></td>
- </tr>
- <tr>
- <td align="right">(Reason):<br></td>
- <td><input type="Text" name="reason"><br></td>
- </tr>
- <tr>
- <td align="right">Action taken by:<br></td>
- <td><input type="Text" name="by"><br></td>
- </tr>
- <tr>
- <td align="right">Additional comments:<br></td>
- <td><input type="Text" name="cmnt"><br></td>
- </tr>
- <tr>
- <td></td>
- <td align="center"><input type="Submit" value="Submit"><br></td>
- </tr>
- </table>
- </form>';
- // this counter stuff was just practising how to access files and edit them.
- $counter = fopen("countersuccess.txt","r+");
- $counteramount = fgets($counter, 10);
- if($counteramount == "")
- {
- $counteramount = 0;
- }
- $counteramount++;
- rewind($counter);
- fwrite($counter, $counteramount);
- fclose($counter);
- echo "<br><br><br><a href=counterstats.php>Visit the stats.</a>";
- }
- else if($user == "" OR $pass == "")
- {
- echo "You didn't fill out every textbox.";
- $counter = fopen("counterfail.txt","r+");
- $counteramount = fgets($counter, 10);
- if($counteramount == "")
- {
- $counteramount = 0;
- }
- $counteramount++;
- rewind($counter);
- fwrite($counter, $counteramount);
- fclose($counter);
- }
- else
- {
- echo "Login failed.";
- $counter = fopen("counterfail.txt","r+");
- $counteramount = fgets($counter, 10);
- if($counteramount == "")
- {
- $counteramount = 0;
- }
- $counteramount++;
- rewind($counter);
- fwrite($counter, $counteramount);
- fclose($counter);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement