Error, you' . "'" . 've got to specify your guestbook-ID


'); die(''); } include("dbconnect.php"); $mysql = "SELECT COUNT(ID) AS totaal FROM `gb_" . $ID . "`"; $mysql_result = mysql_query($mysql) or die("Kan zoekopdracht niet uitvoeren"); $row = mysql_fetch_array($mysql_result); $aantal=$row['totaal']; $query = "SELECT * FROM gb_data WHERE ID='$ID'"; $result = mysql_query($query) or die('Error ! Unable to complete database-request'); $q_result = mysql_fetch_array($result, MYSQL_ASSOC); $tekst[rijperpag] = $q_result[rijperpag]; $tekst[welkom] = $q_result[txt_welkom]; $tekst[bekijken] = $q_result[txt_bekijken]; $tekst[tekenen] = $q_result[txt_tekenen]; $tekst[page] = $q_result[txt_page]; $tekst[naam] = $q_result[txt_naam]; $tekst[email] = $q_result[txt_email]; $tekst[bericht] = $q_result[txt_bericht]; $tekst[verz] = $q_result[txt_verz]; $tekst[formok] = $q_result[txt_formok]; $tekst[formnok] = $q_result[txt_formnok]; $tekst[f_header] = '

' . $tekst[welkom] . '
Total Messages: ' . $aantal . ''; $tekst[f_bekijk] = '

' . $tekst[bekijken] . '

'; $tekst[f_teken] = '

' . $tekst[tekenen] . '

'; mysql_close($link); if ($action == "view") bekijk($ID, $tekst, $page); elseif ($action == "sign") nieuw($ID, $tekst, $naam, $email, $bericht); elseif ($action == "sign2") controleer($ID, $tekst, $naam, $email, $bericht); else { print($tekst[f_header] . $tekst[f_bekijk] . $tekst[f_teken]); } function bekijk($ID, $tekst, $page) { print"

$tekst[f_teken]

$tekst[f_header]
"; print "

\n"; // Maak selectie if ($page == 0) $page = 1; $pag[stop] = $tekst[rijperpag] * $page; $pag[start] = $pag[stop] - $tekst[rijperpag]; include("dbconnect.php"); $query = "SELECT * FROM `gb_" . $ID . "` ORDER BY `ID` DESC LIMIT $pag[start], $pag[stop]"; $result = mysql_query($query) or die('Error ! Unable to complete database-request'); $queryb = "SELECT * FROM `gb_" . $ID; $resultb = mysql_query($queryb) or die('Error ! Unable to complete database-request'); $cpag = mysql_num_rows($resultb) / $tekst[rijperpag]; if ($cpag > number_format($cpag, 0)) $cpag = number_format($cpag, 0) + 1; else $cpag = number_format($cpag, 0); while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { $i = 0; foreach($line as $col_value){ if ($i == 1) $d_name = $col_value; elseif ($i == 2) $d_email = $col_value; elseif ($i == 3) $d_bericht = $col_value; elseif ($i == 4) $d_time = $col_value; elseif ($i == 5) { $d_date = $col_value; //Security $d_bericht = ereg_replace("
", "::breakcodestrip::", $d_bericht); $d_bericht = strip_tags($d_bericht); // Smilies extension by Shadow $d_bericht = ereg_replace("::breakcodestrip::", "
", $d_bericht); $d_bericht = eregi_replace("http://[^[:space:]]+","\\0",$d_bericht); $d_bericht = eregi_replace("([a-zA-Z0-9_-]+)@([a-zA-Z0-9\._-]+)(\.[a-zA-Z]+)", "\\1@\\2\\3", $d_bericht); $d_bericht = str_replace(":p","",$d_bericht); $d_bericht = str_replace(":-p","",$d_bericht); $d_bericht = str_replace(":-P","",$d_bericht); $d_bericht = str_replace(":(","",$d_bericht); $d_bericht = str_replace(":'(","",$d_bericht); $d_bericht = str_replace(":-(","",$d_bericht); $d_bericht = str_replace(":)","",$d_bericht); $d_bericht = str_replace(":-)","",$d_bericht); $d_bericht = str_replace(":D","",$d_bericht); $d_bericht = str_replace(":-D","",$d_bericht); $d_bericht = str_replace(":d","",$d_bericht); $d_bericht = str_replace(":-d","",$d_bericht); $d_bericht = str_replace(";)","",$d_bericht); $d_bericht = str_replace(";-)","",$d_bericht); $d_bericht = str_replace("(k)","",$d_bericht); // END Smilies extension print " " ; } $i++; } } print"
$d_name
Bericht geplaatst op $d_date - $d_time
$d_bericht

"; print('

'); for ($i = 1; $i <= $cpag; $i++) { if ($i == $page) { if ($i == $cpag) print(" $tekst[page] $i"); else print(" $tekst[page] $i -"); } else { if ($i == $cpag) print(' ' . $tekst[page] . ' ' . $i . ''); else print(' ' . $tekst[page] . ' ' . $i . ' -'); } } print('

'); mysql_close($link); print"

$tekst[f_teken]

"; } function nieuw($ID, $tekst, $naam, $email, $bericht) { print "
"; print('
' . $tekst[naam] . '   ' . $tekst[email] . '
' . $tekst[bericht] . '
' . $tekst[f_bekijk]); } function controleer($ID, $tekst, $naam, $email, $bericht) {session_start(); if (empty($naam) or empty($email) or empty($bericht)) { print('

' . $tekst[formnok] . '

'); nieuw($ID, $tekst, $naam, $email, $bericht); die(); } include("dbconnect.php"); $datum = date("d/m/Y"); $tijd = date("G:i"); $ipch = getallheaders(); if($microtijd <= $_SESSION['Last_Post']){ $Flood_Error = "Sorry, u heeft net ook al een bericht geplaatst"; echo "$Flood_Error";} else { $flooden = 60; $post_tijd = $microtijd + $flooden;$_SESSION['Last_Post'] = $post_tijd; $bericht = ereg_replace("\n", "
", $bericht); $query = "INSERT INTO `gb_1` (`name`, `email`, `bericht`, `time`, `date`, `IP`) VALUES ('$naam', '$email', '$bericht', '$tijd', '$datum', '$tekst[client]')"; $result = mysql_query($query) or die('Error ! Could not add your details to the database'); print($tekst[f_bekijk]); print('

' . $tekst[formok] . '

'); print($tekst[f_bekijk]); $queryb = "SELECT `email` FROM `gb_data` WHERE `ID`='$ID'"; $resultb = mysql_query($queryb) or die('Error ! Could not add your details to the database'); $q_resultb = mysql_fetch_array($resultb, MYSQL_ASSOC); $mailrec = $q_resultb[email]; $headers = ""; $maildata = "Hey daar!\n\nEr heeft zopas iemand jouw gastenboek getekend op moonlyrics.be.tf."; mail($mailrec, "Nieuw bericht in uw MoonLyrics gastenboek", $maildata, "FROM: Moondogske's Gastenboek"); } } ?>