Nothing Special   »   [go: up one dir, main page]



home - guestbook

The Brownie Camera Page Guestbook

To protect commentors and stop spammers, the guestbook is now code protected and email is eliminated.


'; ////////////////////////////////////update below at your own risk :)////////////////////////////////////////////////// $uri=$_SERVER['HTTP_URI']; $ref=$_SERVER['HTTP_REFERER']; $dir = dirname(__FILE__) . "/d" ; $p = $_GET['p']; $edit = $_GET['edit']; if ( $edit != '' ) { $edit = "

Password Required


"; $pwd=$_POST['pwd']; if ( $pwd == $mypwd ) { if ( !isset($p) || $p == '' ) $p=0; else $p=preg_replace("/\#.*/",'',$p); $m=$_POST['m']; $submit=$_POST['submit']; if ( isset($m) ) { if ( preg_match("/delete/i",$submit) ) { unlink("$dir/$p"); $ref=preg_replace("/\?.*/","",$ref); header("Location: $ref"); } else { file_put_contents("$dir/$p",$m); $ref=preg_replace("/edit=[^&]*/","",$ref); header("Location: $ref"); } } else { $m = file_get_contents("$dir/$p"); $i=0; if ($dh= opendir($dir)) { while (false !== ($file = readdir($dh))) { if ( preg_match("/old/",$file ) ) { $olds[$i]=$file; $i++; } } closedir($dh); } if ( $i > 0 ) { sort($olds); $old = "\n"; if ( preg_match("/old/",$p) ) $delete = ""; $edit = "$old

Editing page: $p


$delete

"; echo $header.$title.$edit."
".$footer; } exit; } else { if ( isset($pwd) ) $edit .= "wrong key"; } echo $header.$title.$edit."".$footer; exit; } $n=$_POST['n']; $e=$_POST['e']; $c=$_POST['c']; $code=$_POST['code']; if ( $c != '' && preg_match("/$my_access_code/i",$code) ) { $c = preg_replace("/= $maxmsgs ) { $date=date("Yjdhi"); if ( file_exists("$dir/$maxpage") ) rename("$dir/$maxpage","$dir/old.$date"); while($maxpage) { $maxpage--; $newpage=$maxpage+1; if ( file_exists("$dir/$maxpage") ) rename("$dir/$maxpage","$dir/$newpage"); } $fp=fopen("$dir/0","a+"); fclose($fp); $id=0; } if ( !$id ) $id=0; $date = date( "F j Y, h:i a"); if ( $n == '' ) $n = "Anonymous"; if ( $e != "" ) $m="\n

$n

$date

\n

$c

\n

----------------------------------------------------------

\n"; else $m="\n

$n

$date

\n

$c

\n

----------------------------------------------------------

\n"; if ( $order == 1 ) { $o = file_get_contents($file); $o = preg_replace('/<\? \$id=\d*; \?>/i',"",$o); file_put_contents($file,"$m\n$o"); } else { $fp = fopen($file,"a"); fwrite ($fp, $m); fclose($fp); } $ref=preg_replace("/p=[0-9]*/","",$ref); header("Location: $ref"); } else { $i=0;$j=1; while(1) { if ( file_exists("$dir/$j") ) $j++; else break; } $navp = "\n".$footer; ?>