www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

post.php (975B)


      1 <!DOCTYPE html>
      2 <html>
      3 	<head>
      4 		<title>Admin</title>
      5 		<style>
      6 html {
      7 	font-family:sans-serif;
      8 	background-color:#EFEFEF;
      9 	border-top:5px solid #FF9311;
     10 }
     11 a {
     12 	text-decoration:none;
     13 	color:#4183c4;
     14 }
     15 a:hover {
     16 	text-decoration:underline;
     17 }
     18 a:visited {
     19 	color:#4183c4;
     20 }
     21 
     22 #container {
     23 	width:700px;
     24 	margin:0 auto;
     25 }
     26 		</style>
     27 	</head>
     28 	<body>
     29 	<div id="container">
     30 	<a href="/admin" class="nav">Home</a>
     31 	<plaintext>
     32 <?php
     33 if (isset($_POST['loc'])) {
     34 	$posts = json_decode(file_get_contents($_POST['loc']),TRUE);
     35 	parse_str(str_replace(",", "&", $_POST['vars']), $data);
     36 
     37 	if (!(isset($data["title"]))) {
     38 		$data["title"] = uniqid();
     39 	}
     40 
     41 	$posts[$data["post"]] = array_merge($data,array("content" => $_POST["post"]));
     42 	$fp = fopen($_POST['loc'], 'w');
     43 	fwrite($fp, json_encode($posts));
     44 	fclose($fp);
     45 	$output = json_decode(file_get_contents($_POST['loc']),TRUE);
     46 	echo $output[$data["post"]]["content"];
     47 }
     48 echo shell_exec("build /var/web/www/site/ -d /var/web/www/");
     49 ?>
     50