################################################################################## # A Simple PHP GuestBook Script written by Andrea Cabibbo # ###### # # Feel free to modify the code to suit your needs # # # # # Redistribution is NOT allowed and will be prosecuted # # # # # Version: v-free-0.55 ####### # # # If you find bugs or have suggestions, please contact # # # # # the author at the PHP Guestbook official home page: # # ###### # # # # http://www.cellbiol.com/scripts/free_php_guestbook/free_php_guestbook.html # ################################################################################## # The directory/folder containing this file should be set to a 777 permission. # The html guestbook file and the configuration files (conf.php) need at least a 666 permission for the script to work # THE CONFIGURATION VARIABLES ARE NOW IN THE include/conf.php FILE //You re not allowed to modify the copyright notices and powered by lines within the source code //To use this version of the script you need to link to us from the html guestbook page where the messages are posted //To avoid linking back to us in your static pages, please get the enhanced version at http://www.cellbiol.com/scripts/free_php_guestbook/free_php_guestbook.html error_reporting(1); $powby="Powered by dtw-online.nl ©";// editing of the powered by lines is not allowed $pwb2="Powered by dtw-online.nl ©";// editing of the powered by lines is not allowed $conf_file="include/conf.php"; //the configuration file include $conf_file; include $used_language; include "include/classes.php";include "include/functions.php"; include "include/mixvar.php";include "include/html/forms.php";include "include/html/mix_html.php"; $date=EncodeMessage($date); //if (preg_match("/cellbiol/",$thegb)>0){echo "you are cheating
";}
$create_post_array='$post_array=array("post_id"=>$post_id,"name"=>$name,"email"=>$email,"message"=>$message,"date"=>$date,"ip_addr"=>$ip_addr,"show_email"=>$show_email,"show_message"=>$show_message,"approved"=>$approved);';
$login_header=$login_style."".$gbook_title."
You can avoid linking to us by getting the Enhanced version");} # Checking for missing name or message if ($name==''){die($nam_field_empty);}# the script stops if the name is missing if (count($name)>40){die ("The name is too long");} if (count($email)>40){die ("The e-mail is too long");} if ($message==''){die($mes_field_empty);}# the script stops if the message is missing # Checking the overall message length if (strlen($message)>$max_message_length){die ($mes_too_long);} # CHECKING FOR TOO LONG WORDS THAT COULD BREAK THE PAGE DESIGN if (CheckLongWords($message, $max_word_length)==0){die ($mes_word_too_long);} ##### CHECK TO SEE IF THE POSTER IS ADMIN #### elseif ($enable_image_verification_step==1){ if ($use_sessions==1){session_unset();session_start();} $new_string=CreateCaptchaImage(); if ($use_sessions==1){$_SESSION['new_string'] = $new_string;} elseif ($use_sessions==0) {$fp = fopen('temp_code.txt', "w");$write = fputs($fp, $new_string);fclose($fp);} echo "
";
echo "
";
echo "$type_captcha_code
$important:
$captcha_pag_warn";
eval("\$captcha_form = \"$captcha_form\";");
echo $captcha_form;
echo "
"; $post=new Post($post_array); #$post->SetThisVarsFromPostArray($post_array); #$gb=new Guestbook; $gb->AddPost($post_array); $message=$post->RemoveBreaks($message); $post_log=$post->MailLogLine("log"); $mail_log=$post->MailLogLine(); writelog($logfile,$post_log); if ($sendmail_onpost==1){ eval("\$email_mssg1 = \"$email_mssg1\";"); msendmail($gbook_email,$admin_email,$email_subj1,$email_mssg1); } echo($confirm); } else{ echo($confirm2); if ($sendmail_onspam==1){ eval("\$email_mssg2 = \"$email_mssg2\";"); msendmail($gbook_email,$admin_email,$email_subj2,$email_mssg2); } } } # end "if captcha disabled" } # END if task=postnm elseif ($task=="ShowPendingMessages"){ echo "The posts moderation mode is only available in the Enhanced version"; } elseif ($task=="approve"){ echo "The posts moderation mode is only available in the Enhanced version"; } elseif ($task=="ShowPrivatePost") { session_start(); if ($_SESSION['adm_pass']==$admin_pass OR $posted_pass==$admin_pass) { $_SESSION['adm_pass']=$admin_pass; $gb->ShowPrivatePost($post_id); } else { echo "