diff options
Diffstat (limited to 'submit.php')
-rwxr-xr-x | submit.php | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1,13 +1,21 @@ <?php + $path = str_replace( basename( $_SERVER['SCRIPT_NAME'] ), "", $_SERVER['SCRIPT_NAME'] ); + + if ( isset( $_SERVER['HTTP_HOST'] ) ) { + $hostname = $_SERVER['HTTP_HOST']; + } else { + $hostname = $_SERVER['SERVER_NAME']; + } + 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" ); + header( "Location: http://" . $hostname . $path . $id ); } else { - header( "Location: http://p.of.je" ); + header( "Location: http://" . $hostname . $path ); } ?> |