Gastenboek
if($_GET["message"] == "1") echo "
FOUT: je mag maximaal 255 tekents tijpen. Jij typte ".$_GET["l"]." Tekens.";
elseif($_GET["message"] == "2") echo "
FOUT: je typte volgend verboden woord: ( ".$_GET["cw"]." )";
elseif($_GET["message"] == "3") echo "
FOUT: je dient de beveiligingscode correct over te typen.";
elseif($_GET["message"] == "4") echo "
FOUT: je kan niet zo snel achter elkaar een bericht plaatsen.";
elseif($_GET["message"] == "5") echo "
Bedankt, je bericht is toegevoegd.";
$ve1riXfi3caYti5onZ = rand(0,9)."".rand(0,9)."".rand(0,9)."".rand(0,9);
?>
Pagina:
/*
Silentum Guestbook v1.2.0
Modified March 4, 2007
pages.php copyright 2006, 2007 "HyperSilence"
*/
$guestbook_file = "guestbook.txt";
$lines = file($guestbook_file);
$total_entries = count($lines);
if(!$_SERVER["QUERY_STRING"]) {
$page = 1;
}
else {
$page = $_GET["page"];
}
$sum = $total_entries / 5;
$floor = floor($sum);
if($sum == $floor) {
$pagenumber = $floor;
}
else {
$pagenumber = $floor + 1;
}
if($page > 1) {
echo "
« ";
}
else {
echo "« ";
}
for($i = 1; $i <= $pagenumber; $i++) {
if($i == $page) {
echo $i." ";
}
else {
echo "
".$i." ";
}
}
if($page < $pagenumber) {
echo "
» ";
}
else {
echo " »";
}
?>
/*
Silentum Guestbook v1.2.0
Modified March 4, 2007
view.php copyright 2006, 2007 "HyperSilence"
*/
$guestbook_file = "guestbook.txt";
$lines = file($guestbook_file);
$total_entries = count($lines);
if(!$_SERVER["QUERY_STRING"]) {
$page = 1;
}
else {
$page = $_GET["page"];
}
$minimum = 5 * ($page - 1);
$maximum = 5 * $page - 1;
foreach($lines as $line_number => $line) {
if($line_number < $minimum) {}
elseif($line_number > $maximum) {
break;
}
else {
$entrynumber = $total_entries - $line_number;
echo $line;
}
}
?>
Teken het gastenboek: