Advertisement
Guest User

Untitled

a guest
Jun 12th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.06 KB | None | 0 0
  1. <?php
  2. $user = "Javi";
  3. $pass = "sucks";
  4. $path = "C:/I/Suck/";
  5. $name = "vcmp-server.exe"; //Has to be renamed to something unique!
  6. if ($_SERVER["PHP_AUTH_USER"] != $user || $_SERVER["PHP_AUTH_PW"] != $pass)
  7. {
  8. header("WWW-Authenticate: Basic realm=\"U haz to enter username & pass for ownage panel!\"");  
  9. header("HTTP/1.0 401 Unauthorized");
  10. echo 'OMFG WHY YOU PRESSED CANCEL, NO COOKIE FOR U!';
  11. exit;
  12. }    
  13. else
  14. {
  15. headerz();
  16. echo '<h1>Javi\'s Control Panel</h1>
  17. <br/>';
  18. if (isset($_POST['action'])) {
  19. if ($_POST['action'] == "Start") {
  20. $ex = exec($path.$name);
  21. header("Refresh: 4; URL=index.php");
  22. if ($ex) echo '<p>Server started!</p>';
  23. else echo '<p>Something went wrong, Forgot to set the Path?</p>';
  24. }
  25. elseif ($_POST['action'] == "Stop") {
  26. $ex = exec("taskkill /IM ".$name);
  27. header("Refresh: 4; URL=index.php");
  28. if ($ex) echo '<p>Server Stopped!</p>';
  29. else echo '<p>Something went wrong, Forgot to set the Path?</p>';
  30. }
  31. }
  32. else {
  33. echo '<form action="index.php" method="POST">
  34. <p><input type="submit" value="Start" name="action"/> | <input type="submit" value="Stop" name="action"/></p>
  35. </form>';
  36. footer();
  37. }
  38. }
  39. function headerz() {
  40. echo '<head>
  41.  <title>Javi\'s Control Panel</title>
  42.  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  43.  <style type="text/css">
  44.    body { background-color: #e0e0e0; padding: 0px; text-align: center; font-family: "Arial", Sans-serif; font-size: 11px; line-height: 16px; font-weight: normal; color: #242424; }
  45.    #wrapper { margin: 0px auto; margin-top: 50px; background-color: #fff; text-align: center; width: 672px; border: 1px solid #b8b8b8; }
  46.    #pre { background-color: #fff; text-align: center; padding: 0px 10px 5px 10px; margin: 5px 5px 5px 5px; border: 1px solid #e9e9e9; }
  47.    p { font-size: 11px; color: #242424; text-align: center; padding-left: 17px; padding-right: 17px; }
  48.    h1 { font-size: 16px; font-weight: bold; color: #242424; padding-left: 17px; }
  49.  </style>
  50. </head>
  51. <body>
  52.  <div id="wrapper"><div id="pre">
  53. ';
  54. }
  55. function footer() {
  56. echo '</div></div>
  57. </body>
  58. </html>';
  59. }
  60. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement