Advertisement
Guest User

Untitled

a guest
Apr 14th, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  1. <?php
  2. $username = "user";
  3. $password = "password";
  4.  
  5. if(isset($_POST['username']) && $_POST['password'])
  6. {
  7.     if($_POST['username'] == $username && $_POST['password'] == $password)
  8.     {
  9.         $_SESSION['user'] = $username;
  10.     }
  11.     else{
  12.          header( "refresh:1" );
  13.     }
  14. }
  15. if($_SESSION['user'])
  16. {
  17. ?>
  18. <html>
  19. <head>
  20.   <title>Rebooting Server</title>
  21. </head>
  22. <body>
  23.   <h1>Rebooting Server</h1>
  24.   <pre>
  25.   <?php passthru("/usr/bin/sudo /root/resolve.sh"); ?>
  26.   </pre>  
  27. </body>
  28. </html>
  29. <?php
  30. }
  31. else{
  32. ?>
  33. <html>
  34. <head>
  35.   <title>Rebooting Server</title>
  36. </head>
  37. <body>
  38.   <h1>LOGIN</h1>
  39.  <form action="" method="">
  40.     <input type="text" name="username">
  41.     <input type="text" name="password">
  42.     <input type="submit" name="login">
  43.  </form>
  44. </body>
  45. </html>
  46. <?php
  47. }
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement