Last active
October 25, 2016 06:39
-
-
Save ildarkhasanshin/4a275a7cb305f2034221b70cb54d84b0 to your computer and use it in GitHub Desktop.
report_admin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$path = htmlspecialchars($_REQUEST['path']); | |
$type = htmlspecialchars($_REQUEST['type']); | |
if (!empty($path)) { | |
switch ($type) { | |
case 'email': | |
$header = "Content-type:text/html; charset=\"utf-8\"\r\n"; | |
$header .= "From: " . $_SERVER["SERVER_NAME"] . " <noreply@" . $_SERVER["SERVER_NAME"] . ">\r\n"; | |
if (mail("email@gmail.com", $_SERVER["SERVER_NAME"] . '/report_admin.php', 'check url: ' . $path, $header)) { | |
header('Location: /'); | |
exit(); | |
} | |
break; | |
default: | |
$filename = $_SERVER['DOCUMENT_ROOT'] . '/report_admin.txt'; | |
$tmp = file_get_contents($filename); | |
file_put_contents($filename, $tmp . "\r\n" . $path); | |
header('Location: /'); | |
exit(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment