Updated with frontend and added new features
This commit is contained in:
31
admin.php
Executable file
31
admin.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
if ($_POST) {
|
||||
$text = preg_replace("/\s{2}/i","\n",$_POST['text']);
|
||||
file_put_contents("mac_log.csv",$text);
|
||||
header ("Location: ".$_SERVER['PHP_SELF']."?saved=true");
|
||||
exit;
|
||||
}
|
||||
$text = htmlspecialchars(file_get_contents("mac_log.csv"));
|
||||
|
||||
if($_GET['saved'] == "true") {
|
||||
$message = "Saved successfully.";
|
||||
}
|
||||
|
||||
|
||||
?><html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
textarea { height: 600px; width: 400px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<span class="message">
|
||||
<?php echo $message; ?>
|
||||
</span>
|
||||
<form method="POST">
|
||||
<textarea name="text"><?php echo $text; ?></textarea>
|
||||
<input type="submit" value="Save">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user