Location: PHPKode > projects > Guestbook and Comment Box > gb_include.php
<?
	include_once("gb_admin/gb_config.php");
	include_once("gb_admin/guestbook/functions/gb_functions.php");
	
	if(isset($_POST['submit']))
	{
		$url = $comment = $author = $email = '';
		$error = false;
		if($captcha){
			require_once('gb_admin/recaptchalib.php');
			$resp = recaptcha_check_answer ($privatekey,$_SERVER["REMOTE_ADDR"],$_POST["recaptcha_challenge_field"],$_POST["recaptcha_response_field"]);
			if (!$resp->is_valid) {
				// What happens when the CAPTCHA was entered incorrectly
				$status = CAPTCHA_ERROR;
				$error = true;
			}
		}
		
		if(!$error)
		{
			$comment = strip_tags($_POST['comment']);
			
			if($display_username_box){$author = strip_tags($_POST['author']);}
			if($display_user_email){$email = strip_tags($_POST['email']);}
			if($display_user_website){$url = strip_tags($_POST['url']);}
			
			if($display_username_box && $author == ""){
				$status = AUTHOR_ERROR."<br />";
				$error = true;
			}
			if($display_user_email && $email == ""){
				$status .= EMAIL_ERROR."<br />";
				$error = true;
			}
			if(trim($comment) == ""){
				$status .= COMMENT_ERROR."<br />";
				$error = true;
			}
			if(!$error)
			{
				$status = addGBComment($author,$email,$url,$comment,$unique_id);
			}
		}	
	}
	
	$result_gb_comments = getComments($unique_id);
	
	include_once("gb_template.php");

?>
Return current item: Guestbook and Comment Box