summaryrefslogtreecommitdiff
path: root/submit.php
diff options
context:
space:
mode:
authorPhil Burton <philbeansburton@gmail.com>2013-02-14 14:00:48 +0000
committerPhil Burton <philbeansburton@gmail.com>2013-02-14 14:00:48 +0000
commit60904c4e934841e1553e078e51120d3c3d274a75 (patch)
tree03b43c282a591c3ac2974c19459d616ad86ef988 /submit.php
parent0e508f7e42fa06647dbf9623f2ea86d2c52744d4 (diff)
removed html form submit.php. Redirected any calls to submit with out a "paste request" or with an empty "paste request".
Diffstat (limited to 'submit.php')
-rwxr-xr-xsubmit.php43
1 files changed, 14 insertions, 29 deletions
diff --git a/submit.php b/submit.php
index 40bd75e..3270232 100755
--- a/submit.php
+++ b/submit.php
@@ -1,29 +1,14 @@
-<!DOCUMENT html
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
-</head>
-<body>
-
- <?php
-
- $paste = $_POST["paste"];
- $id = dechex(crc32($paste));
-
- $fh = fopen($id, "w");
-
- fwrite($fh, $paste);
-
- fclose($fh);
-
- $out = "<p>Paste Added: <a href='http://p.of.je/$id'>http://p.of.je/$id</a></p>";
- header("Location: http://p.of.je/$id");
- ?>
-
- <p>
- <a href="http://p.of.je/">Go Back</a>
- </p>
-</body>
-</html>
-
-
+<?php
+ if(isset($_POST["paste"] && $_POST["paste"] != "" ) {
+ $paste = $_POST["paste"];
+ $id = dechex(crc32($paste));
+ $fh = fopen($id, "w");
+ fwrite($fh, $paste);
+ fclose($fh);
+ header("Location: http://p.of.je/$id");
+ }
+ else
+ {
+ header("Location: http://p.of.je");
+ }
+?>