Advertisement
Guest User

Untitled

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