Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 3 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 47 additions and 0 deletions.
  1. +24 −0 index.php
  2. +23 −0 process.php
  3. 0 storageFile.txt
View
24 index.php
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>Wall of the World</title>
+</head>
+
+<body>
+<?php
+$data = array_slice(file('storageFile.txt'), -30);
+
+foreach ($data as $line) {
+ echo "<pre>$line</pre>";
+}
+?>
+
+<div id="postInput" style="width:100%;min-width:1000px;position:fixed;bottom:0px;left:0px;border-top:1px dashed #aaa;padding:20px 0 20px 5px;background:#ddd;">
+<form action="process.php" method="POST">
+<input type="text" name="textInput" maxlength="160" style="width:93%;">
+<input type="text" name="name" style="display: none; visibility: hidden;">
+<input type="submit" value="Post">
+</form></div>
+
+</body>
+</html>
View
23 process.php
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="REFRESH" content="0;url=http://www.example.com/wall/"></head>
+<body>
+<?php
+if (($_POST['name']) != '')
+ return true;
+$textInput = $_POST['textInput'];
+if (($textInput) == '')
+ return true;
+$textInput = htmlEntities($textInput, ENT_QUOTES);
+$textInput = stripslashes($textInput);
+$timestamp = date("Y-m-d H:i:s");
+$storageFile = "storageFile.txt";
+$fh = fopen($storageFile,'a') or die("can't open file");
+$stringDATA = "[{$timestamp}Z] {$textInput}\n";
+fwrite($fh,$stringDATA);
+fclose($fh);
+mail('mail@example.com', $timestamp . ' Post submitted.', $stringDATA);
+?>
+</body>
+</html>
View
0 storageFile.txt
No changes.

No commit comments for this range

Something went wrong with that request. Please try again.