{$data['clan']}: Clan Message | n";
if(isset($_POST['message'])) {
$dbres = mysql_query("SELECT * FROM `[temp]` WHERE `id`='{$_POST['id']}' AND `code`='{$_POST['code']}' AND `area`='message'");
if(($check = mysql_fetch_object($dbres)) && $check->IP == $clientIP) {
$dbres = mysql_query("SELECT `login` FROM `[users]` WHERE `Mobieltje`=1 AND `clan`='{$data['clan']}'");
while($member = mysql_fetch_object($dbres)) {
$_POST['subject'] = preg_replace('/','<',$_POST['subject']);
$_POST['message'] = preg_replace('/','<',$_POST['message']);
mysql_query("INSERT INTO `[messages]`(`time`,`from`,`to`,`subject`,`message`) values(NOW(),'{$data['clan']}','{$member->login}','{$_POST['subject']}','{$_POST['message']}')");
mysql_query("DELETE FROM `[temp]` WHERE `id`='{$_POST['id']}' AND `code`='{$_POST['code']}' AND `area`='message'");
}
}
print " Clan Bericht verzonden |
n";
}
$code = rand(100000,999999);
mysql_query("INSERT INTO `[temp]`(login,IP,code,area,time) values('{$data['login']}','$clientIP','$code','message',NOW())");
$id = mysql_insert_id();
print <<
|