EOT; if($action == 'post'){ $reference_id = md5(mktime()*rand()); echo <<

Kainas Guestbook - Post

Name

Message:
Human Verification

EOT; } elseif($action == 'post_process'){ $sdate = time(); list($match_text) = mysql_fetch_array(mysql_query("SELECT hiddentext FROM security_images WHERE referenceid='$_REQUEST[refid]'")); if(strstr($match_text,$_REQUEST[security])){ $result = mysql_query("insert into entries set adddate='$sdate', name='$_REQUEST[name]', message='$_REQUEST[message]', active='0'"); if(!mail('kaina@kainas.com', "Holy flying guestbooks batman", "Some idiot posted on your guestbook", 'From: nucz@mindspring.com', '-fnucz@mindspring.com')){ echo "

WTF, mail did not send

\n"; } echo <<

Kainas Guestbook - Post Success

Your entry has been posted and is awaiting validation from Jaime or Will before it will show live on the guestbook.

Return to the Guestbook

EOT; exit; } else { $reference_id = md5(mktime()*rand()); echo <<

Kainas Guestbook - Post Error

There was an error in your submission. Please make sure you enter the Human Verification code properly.

Name

Message:
Human Verification

EOT; } } else { echo "

Kainas Guestbook

\n"; echo "

Make a New Post

\n"; $result = mysql_query("select * from entries where active='1' order by adddate DESC"); while($obj = mysql_fetch_object($result)) { $author = ucwords(strtolower($obj->name)); $message = nl2br(trim(rtrim($obj->message))); $date = date("l F jS Y", $obj->adddate); $time = date("g:ia T", $obj->adddate); echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " $author on $date at $time
\n"; echo "
\n"; echo " $message\n"; echo "
\n"; echo " Post a Note
\n"; echo "
\n"; echo "
\n"; } } echo <<  
EOT; ?>