blob: 2be2b1bccb4e21d8378e64bad891ec5c2f789796 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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://" . $hostname . $path . $id );
}
else {
header( "Location: http://" . $hostname . $path );
}
?>
|