your comment in guestbook

"; function getyourcode(){ $randnumber = rand(0 , 9); return $randnumber; } // File that contains the data $filelocation="gbook_data.php"; //Name of this document here $boardname="guestbook.php"; // The message to display when someone entered data $name is the name then $thanksmessage="

Thanks for your message, $name!
"; // The message to display, if there is an error $errormessage="

You must enter your name and a message as well as have the proper verification code!
"; // The message to display, if there is an error $errormessage2="

It appears you are trying to double-post...

Please return:
"; // Defines, if special characters should be converted to their html equivalents like > to > // 1 enables and 0 disables this feature $specialchars=1; // Defines, if Ascii linebreaks (people pressing enter while filling the form should become // html linebreaks
// 1 enables and 0 disables this feature $linebreaks=1; // Entrytext, displayed every time the guestbooks gets loaded $entrytext = ""; // Maximal length of the words, to prevent someone killing your layout $maxwordlength = 30; // Rules, displayed when you enter some text... $rules = ""; //Captions $cap_submit="Submit"; $cap_msg="Message:"; $cap_noenty="Kein Eintrag bis jetzt!"; //Colors, Styles $col_tb="#CCCCCC"; $curentcheck= $HTTP_GET_VARS[currentcheck]; $edit= $HTTP_GET_VARS[edit]; $name= $HTTP_GET_VARS[name]; $email= $HTTP_GET_VARS[email]; $url= $HTTP_GET_VARS[url]; $message= $HTTP_GET_VARS[message]; $vericode=$HTTP_GET_VARS[vericode]; $vcode=$HTTP_GET_VARS[vcode]; /*----------------------------------------------------------------------------------------------- Adding a new entry to the data file ------------------------------------------------------------------------------------------------*/ if ($edit == "yes"){ If ($currentcheck == 666){ echo "

$errormessage2"; echo "here "; exit; } // test if someone forgot to enter spaces. $spaces = explode(" ",$message); for ($i=0;$i $maxwordlength) $bozo="yes"; } $spaces = explode(" ",$name); for ($i=0;$i $maxwordlength) $bozo="yes"; } // When there is missing data, display the errormessage and reprint the form if ($name == "" || $message =="" || $bozo == "yes" || $vericode != $vcode){ $vericode=""; For ($x=1;$x <=5;$x++){ $randnumber = rand(0 , 9); $vericode= $vericode . $randnumber; $randgif[$x]= $randnumber . ".gif"; } echo "
$errormessage\n"; if ($bozo = "yes") echo ""; echo"Let's try again...
"; $action= "new"; } // If all the entries are correct, display thanksmessage add to datafile else { $vericode = 678493999; echo "

$thanksmessage\n"; echo "

 

view recent posts\n"; // Change % and # to percent and no, to avoid wrong splitting of the data. $message = eregi_replace("#","no.",$message); $message = eregi_replace("%","percent",$message); $name = eregi_replace("#","no.",$name); $name = eregi_replace("%","percent",$name); // When specialchars are to be replaced... if ($specialchars==1){ $message=htmlentities($message); $name=htmlentities($name); } // When ASCII Linebreaks should become
s if ($linebreaks==1){$message = nl2br($message);} // When there is no datafile yet, create a new one if (!file_exists($filelocation)) { $newfile = fopen($filelocation,"w+"); fclose($newfile); } // Add the data to the end of the datafile $newfile = fopen($filelocation,"a+"); $add = "%".$name."#".$email."#".$url."#".date("F jS Y, \a\\t G.i ")."#".$message."\n"; fwrite($newfile, $add); fclose($newfile); // echo ""; } } /*----------------------------------------------------------------------------------------------- Introduction Screen when there is no data from the form ------------------------------------------------------------------------------------------------*/ if ($action != "view" && $action !="new"){ if ($edit=="yes"){ } else { echo $entrytext; } } /*----------------------------------------------------------------------------------------------- Display the guestbook ------------------------------------------------------------------------------------------------*/ if ($action=="view"){ echo $entrytext; // When there is no data file, create a new one and say there are no entries. if (!file_exists($filelocation)) { $newfile = fopen($filelocation,"w+"); fclose($newfile); echo $cap_noentry; } // Open the datafile and read the content $newfile = fopen($filelocation,"r"); $content = fread($newfile, filesize($filelocation)); fclose($newfile); // Remove the slashes PHP automatically puts before special characters $content=stripslashes($content); // Put the entries into the array lines $lines = explode("%",$content); // Define and fill the reverse array (showing the last entry first) $rev=array(); for ($i=sizeof($lines)-1;$i>0;$i--){array_push($rev,$lines[$i]);} $lines=$rev; // Display all the entries of the guestbook while(list($key)= each ($lines)){ /* / split the data lines into a user array / user[0] is the name, [1] is the email, [2] is the url [3] is the date and [4] the message */ $urladd=""; $mailadd=""; $user = explode("#",$lines[$key]); // if there is an email, display an email link if ($user[1] != ""){$mailadd="email";} // if there is a url, display a link if ($user[2] != ""){ // if people were dumb enough not to add http:// do so if (substr($user[2],0,7)!= "http://"){ $user[2]="http://".$user[2]; } $urladd="Homepage"; } echo "

"; echo "
$user[0]  $mailadd $urladd  ($user[3])"; echo "
"; // Display the entries, here you can tweak HTML echo " $user[4]\n"; echo "
"; } } /*----------------------------------------------------------------------------------------------- Add a new entry to the guestbook, display the rules and show the form. ------------------------------------------------------------------------------------------------*/ if ($action == "new"){ $vericode=""; For ($x=1;$x <=5;$x++){ $randnumber = rand(0 , 9); $vericode= $vericode . $randnumber; $randgif[$x]= $randnumber . ".gif"; } echo "$rules
\n
\n
"; if ($bozo = "yes") echo ""; echo "
Name:
eMail:
url:
$cap_msg:
Verification Code is:
Enter Code above:
"; } ?>

 

         not responsible for content of written comments