diff options
Diffstat (limited to 'submit.php')
-rwxr-xr-x | submit.php | 43 |
1 files changed, 14 insertions, 29 deletions
@@ -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"); + } +?> |