Error !!Can't create data file.
"; exit; } } else { if ($max_record_in_data_file <> "0"): $f = file($data_file); rsort($f); $j = count($f); if ($j > $max_record_in_data_file): $rf = fopen($data_file,"w"); if (strtoupper($os)=="UNIX") { if (flock($rf,2)): for ($i=0; $i<$max_record_in_data_file; $i++): fwrite($rf,$f[$i]); endfor; flock($rf,3); endif; } else { for ($i=0; $i<$max_record_in_data_file; $i++): fwrite($rf,$f[$i]); endfor; } fclose($rf); endif; endif; } switch ($do) { case "": $record = file($data_file); rsort($record); $jmlrec = count($record); ?> <?echo "$title"?>

nancy lee grahn [dot] com // guestbook
nancy lee grahn [dot] com // guestbook
nancy lee grahn [dot] com // guestbook
nancy lee grahn [dot] com // guestbook
nancy lee grahn [dot] com // guestbook
nancy lee grahn [dot] com // guestbook
nancy lee grahn [dot] com // guestbook

 

n a n c y   l e e   g r a h n   [dot]   c o m

g u e s t b o o k

0) $jml_page++; $no = $page*$max_entry_per_page-$max_entry_per_page; if ($jmlrec == 0) echo ""; $w = 0; //--Color for ($i=0; $i<$max_entry_per_page; $i++): $no++; $recno = $no-1; if (isset($record[$recno])): $row = explode("|~~|",$record[$recno]); if ($w==0) { $warna = $table_content_1a; $warna2 = $table_content_1b; $w=1; } else { $warna = $table_content_2a; $warna2 = $table_content_2b; $w=0; } echo ""; echo ""; endif; endfor; echo ""; ?>
Click ">here to sign the guestbook ">Contact webmaster
There is no entry yet.
$no$row[1]
$row[2] from $row[4]
$row[3]"; if (trim($row[6])<>"" and trim($row[6])<>"http://") echo " - Visit my homepage"; echo "

$row[5]

Delete entry # $no
"; if ($jml_page > 1) { if ($page <> 1) echo "[Top] "; else echo "[Top] "; echo "Page # "; if ($jml_page > 10) { if ($page < 5) { $start = 1; $stop = 10; } elseif ($jml_page - $page < 5) { $start = $jml_page - 9; $stop = $jml_page; } else { $start = $page-4; $stop = $page+5; } if ($start <> 1) echo "... "; for ($p=$start; $p<=$stop; $p++): if ($p == $page) echo "$p  "; else echo "$p  "; endfor; if ($stop <> $jml_page) echo "... "; echo "of $jml_page "; } else { for ($p=1; $p<=$jml_page; $p++): if ($p == $page) echo "$p  "; else echo "$p  "; endfor; } if ($page <> $jml_page) echo "[bottom]"; else echo "[bottom]"; } else echo "Page #1 of 1"; echo "

" SIZE=1>">Ard Guestbook 1.0
<?echo "$title"?>

nancy lee grahn [dot] com // guestbook
nancy lee grahn [dot] com // guestbook
nancy lee grahn [dot] com // guestbook
nancy lee grahn [dot] com // guestbook
nancy lee grahn [dot] com // guestbook
nancy lee grahn [dot] com // guestbook
nancy lee grahn [dot] com // guestbook

 

n a n c y   l e e   g r a h n   [dot]   c o m

g u e s t b o o k

"> ">
"> "> "> "> "> ">
*Name :
*Email :
Website :
*Country :
*Comment :

* Required field
'">

© 2003, nancyleegrahn.com

Error !

You may left some fields. Please click here and try again."; exit; } if(!ereg("([[:alnum:]\.\-]+)(\@[[:alnum:]\.\-]+\.+)", $vemail)) { echo "

Error !

Invalid email address. Please click here and try again."; exit; } $test_comment = explode(" ",$vcomment); $jmltest = count($test_comment); for ($t=0; $t<$jmltest; $t++) { if (strlen(trim($test_comment[$t])) > 40) { echo "

Error!

Please don't abuse my guestbook. Click here and try again."; exit; } } $idx = date("YmdHis"); $tgl = date("F d, Y - h:i A"); $vname = str_replace("<","",$vname); $vname = str_replace(">","",$vname); $vname = str_replace("~","-",$vname); $vname = str_replace("\"",""",$vname); $vemail = str_replace("<","",$vemail); $vemail = str_replace(">","",$vemail); $vemail = str_replace("~","",$vemail); $vemail = str_replace("\"","",$vemail); $vcomment = str_replace("<","<",$vcomment); $vcomment = str_replace(">",">",$vcomment); $vcomment = str_replace("~","-",$vcomment); $vcomment = str_replace("\"",""",$vcomment); $vcomment = str_replace("\r\n","
",$vcomment); if (eregi("<|>|\"\~",$vcountry)) $vcountry = "Unknown"; $newdata = "$idx|~~|$tgl|~~|$vname|~~|$vemail|~~|$vcountry|~~|$vcomment|~~|$vurl\n"; $newdata = stripslashes($newdata); $bagus = true; $cekdata = file($data_file); $jmlcekdata = count($cekdata); if ($jmlcekdata > 0): rsort($cekdata); if ($jmlcekdata > 3): $newrow = explode("|~~|",$newdata); $jmlentry = 0; for ($c=0; $c<3; $c++): $cekrow = explode("|~~|",$cekdata[$c]); if ($cekrow[3] == $newrow[3] or ($cekrow[2] == $newrow[2] and $cekrow[4] == $newrow[4])) $jmlentry++; endfor; if ($jmlentry < 3) $bagus = true; else $bagus = false; endif; endif; if ($bagus): $tambah = fopen($data_file,"a"); if (strtoupper($os)=="UNIX") { if (flock($tambah,2)): fwrite($tambah,$newdata); flock($tambah,3); endif; } else fwrite($tambah,$newdata); fclose($tambah); //--SEND MAIL if (strtoupper($notify)=="YES") { $msgtitle = "Someone signed your guestbook"; $vcomment = str_replace(""","\"",$vcomment); $vcomment = stripslashes($vcomment); $msgcontent = "Local time : $tgl\n\nThe addition from $vname reads :\n---------------------\n\n$vcomment\n\n-----End Message-----"; mail($admin_email,$msgtitle,$msgcontent,"From: $vemail\n"); } //----------- endif; if (isset($SERVER_SOFTWARE) && ereg("IIS",$SERVER_SOFTWARE)) { header("Refresh: 0; URL=$PHP_SELF"); echo "

Thank you, your entry has been added.

Please wait...
"; } else echo "

Thank you, your entry has been added.

Please wait...
"; break; case "del": $record = file($data_file); $jmlrec = count($record); for ($i=0; $i<$jmlrec; $i++) { $row = explode("|~~|",$record[$i]); if ($id == $row[0]) { echo " Delete record

Delete Confirmation

$row[1]
$row[2]
from $row[4]
$row[3]

$row[5]

"; break; } } echo "
Admin password :

"; break; case "del2": if ($pwd <> $admin_password) { if (isset($SERVER_SOFTWARE) && ereg("IIS",$SERVER_SOFTWARE)) { header("Refresh: 0; URL=$PHP_SELF?page=$page"); echo "

Invalid admin password !

Please wait...
"; } else { echo "

Invalid admin password !

Please wait...
"; exit; } } $record = file($data_file); $jmlrec = count($record); for ($i=0; $i<$jmlrec; $i++) { $row = explode("|~~|",$record[$i]); if ($id==$row[0]) { $record[$i] = ""; break; } } $update_data = fopen($data_file,"w"); if (strtoupper($os) == "UNIX") { if (flock($update_data,2)) { for ($j=0; $j<$jmlrec; $j++): if ($record[$j] <> "") fputs($update_data,$record[$j]); endfor; flock($update_data,3); } } else { for ($j=0; $j<$jmlrec; $j++): if ($record[$j] <> "") fputs($update_data,$record[$j]); endfor; } fclose($update_data); if (isset($SERVER_SOFTWARE) && ereg("IIS",$SERVER_SOFTWARE)) { header("Refresh: 0; URL=$PHP_SELF?page=$page"); echo "

Record has been deleted !

Please wait...
"; } else echo "

Record has been deleted !

Please wait...
"; break; } //--end switch ?>

© 2003, nancyleegrahn.com