Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $user = "Javi";
- $pass = "sucks";
- $path = "C:/I/Suck/";
- $name = "vcmp-server.exe"; //Has to be renamed to something unique!
- if ($_SERVER["PHP_AUTH_USER"] != $user || $_SERVER["PHP_AUTH_PW"] != $pass)
- {
- header("WWW-Authenticate: Basic realm=\"U haz to enter username & pass for ownage panel!\"");
- header("HTTP/1.0 401 Unauthorized");
- echo 'OMFG WHY YOU PRESSED CANCEL, NO COOKIE FOR U!';
- exit;
- }
- else
- {
- headerz();
- echo '<h1>Javi\'s Control Panel</h1>
- <br/>';
- if (isset($_POST['action'])) {
- if ($_POST['action'] == "Start") {
- $ex = exec($path.$name);
- header("Refresh: 4; URL=index.php");
- if ($ex) echo '<p>Server started!</p>';
- else echo '<p>Something went wrong, Forgot to set the Path?</p>';
- }
- elseif ($_POST['action'] == "Stop") {
- $ex = exec("taskkill /IM ".$name);
- header("Refresh: 4; URL=index.php");
- if ($ex) echo '<p>Server Stopped!</p>';
- else echo '<p>Something went wrong, Forgot to set the Path?</p>';
- }
- }
- else {
- echo '<form action="index.php" method="POST">
- <p><input type="submit" value="Start" name="action"/> | <input type="submit" value="Stop" name="action"/></p>
- </form>';
- footer();
- }
- }
- function headerz() {
- echo '<head>
- <title>Javi\'s Control Panel</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <style type="text/css">
- 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; }
- #wrapper { margin: 0px auto; margin-top: 50px; background-color: #fff; text-align: center; width: 672px; border: 1px solid #b8b8b8; }
- #pre { background-color: #fff; text-align: center; padding: 0px 10px 5px 10px; margin: 5px 5px 5px 5px; border: 1px solid #e9e9e9; }
- p { font-size: 11px; color: #242424; text-align: center; padding-left: 17px; padding-right: 17px; }
- h1 { font-size: 16px; font-weight: bold; color: #242424; padding-left: 17px; }
- </style>
- </head>
- <body>
- <div id="wrapper"><div id="pre">
- ';
- }
- function footer() {
- echo '</div></div>
- </body>
- </html>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement