FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Multi Messaging Members





DanielXP
Im having a few problems with my code.

I used to work, but now with no changes it don't seem to be sending to more than one person.

Heres my code.

Code:
if(isset($_GET[send])) {
$mgsto[] = NULL;
$to = $_POST[to];
$subject = sql_protect($_POST[subject]);
$message = sql_protect($_POST[message]);
$to_name = explode(", ", $to);
$max_send = $message_maxsend[$account[userlevel]];
$current_sent = "1";
$exceeded = NULL;
$suc_msg = NULL;
foreach($to_name as $to2) {
$toalsent = NULL;
if($to2 != NULL) {
$to22 = username2id($to2);
if($to22 == "Username not found") {
$suc_msg .= id2username($to22) . " does not exist. Message not sent.";
}else{
if($current_sent <= $message_maxsend[$account[userlevel]]) {
if(eregi($to22, ";" . $account[friends] . ";")) {
foreach($mgsto as $to_id) {
if($to22 == $to_id) { $toalsent = "sent"; }
}
if($toalsent == "sent") {
$suc_msg .= "Message already sent to " . id2username($to22) . "<br />";
}else{
if(mysql_query("INSERT INTO `messages` (`to_id`, `from_id`, `subject`, `message`, `datetime`, `from_ip`) VALUES ('" . $to22 . "','" . $account[id] . "','" . $subject . "','" . $message . "','" . $full_date . "','" . $ip . "')")) {
$suc_msg .= "Message was sent to " . id2username($to22) . "<br />";
}else{
$suc_msg .= "Message failed sending to " . id2username($to22) . " <i>Unknown reason.</i><br />";
}
}
}else{
$suc_msg .= id2username($to22) . " is not on your friends list. Message could not be sent.<br />";
}
}else{
if($exceeded == NULL) { $suc_msg .= "<br /><i>No more messages sent, Limited exceeded.</i>"; $exceeded = true; }
}
}
}
$mgsto[$current_sent] = $to22;
$current_sent++;
}
?>
<a class="sutitle">Sending Message</a>
<br /><br /><br />
<?
echo $suc_msg;
}


This is the message I get

Quote:
Message was sent to Daniel
Message failed sending to Oliver Unknown reason.
Message already sent to Daniel
DanielXP
Im wondering if its in the code or something to do with the server?
Related topics
How many forum members...
loadurl
Trillian
Members!
Bluetooth
windows xp
Coalition of the Gloating: No Hurricane Relief for USA!
members area
All About Metallica
Frihost Forum Rules
[OFFICIAL] MSN Messenger 8.0 or Windows Live Messenger
Two Singaporean bloggers jailed for anti-Muslim remarks
NORTON 2005 ALL IN ONE:MULTI BOOT CD
[Exclusive on Frihost] learn programming multi-agent Systems
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.