summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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");
+ }
+?>