<?php 
//toddyBOOK (v1) 2006
//quiksilver_shoutbox (v2) 2007
include 'book.inc.php'; 

////////////////HEADER INFO////////////////

header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-type: text/vnd.wap.wml;");
echo '<?xml version="1.0" encoding="utf-8"?>';
print '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">'.
'<wml>
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>';


////////////////INSERT MSG////////////////
echo "<card id=\"shoutbox\" title=\"$title\"><p align=\"center\">";
echo "<b>$title</b><br/>"; 
$result=mysql_query("select * from shoutmsgs where msg='$msg'");
$number_of_rows = mysql_num_rows($result);
if ($number_of_rows>0)
{
$error="1";
echo "an attempt to flood?!?";
}

if ($error==""){

echo "Your shout has been added! $name";
$datime=date("H:i");
$ip=$REMOTE_ADDR;
$dadate=(date("D, j F Y"));
	$sql = "INSERT INTO shoutmsgs (name, msg, site, ip, email, date, time) VALUES ('$name','$msg','$site','$ip','$email','$dadate','$datime')";
$result = mysql_query($sql);
echo "<br/><a href=\"welcome.php?username=$username&amp;password=$password\">Continue....</a>";
echo "<br/>Click back on your browser to return to the site";}


echo "</p></card></wml>";
?>
