balkan7 Posted February 2, 2008 Share Posted February 2, 2008 i used this code for banner expire, send msg when expire, and send msg 1 week before expire, where i wrong... kod: <?php // set banner inactive when expire and send msg whit statistic $result = dbquery("SELECT * FROM ".$db_prefix."btr_banners WHERE banner_state='1'"); while ($data = dbarray($result)) { $time = date("Y-m-d H:i:s"); if ($data['banner_expire'] < $time) { $expires = dbquery("UPDATE ".$db_prefix."btr_banners SET banner_state='0' WHERE banner_id='".$data['banner_id']."'"); $result1 = dbquery("SELECT user_id, user_name, user_email FROM ".$db_prefix."users WHERE user_id='".$data['client_id']."'"); while ($data1 = dbarray($result1)) { $user_name = $data1['user_name']; $user_email = $data1['user_email']; if ($user_email != "") { $result2 = dbquery("SELECT * FROM ".$db_prefix."btr_banners WHERE banner_id='".$data['banner_id']."'"); while ($data2 = dbarray($result2)) { $bannerXtra = explode(".", $data2['banner_clicks']); $bannerClicks = number_format($bannerXtra[0]); $bannerViews = number_format($bannerXtra[1]); if($bannerViews == 0) { $percent = 0; } else { $percent = substr(100 * $data2['banner_clicks'] / $bannerViews, 0, 5); } $to = $user_email; $subject = $locale['M_10']; $message = $locale['M'].$user_name.$locale['M_2'].$data2['banner_date']."<br />".$locale['M_3']."<br />".$locale['M_4'] . $data2['banner_name']."<br />".$locale['M_5'] . $data2['banner_clicks']."<br />".$locale['M_6'] . $bannerViews."<br />".$locale['M_7'] . $data2['banner_date']."<br />".$locale['M_8'] . $data2['banner_expire']."<br /><br /><br /><br />".$locale['M_9']; $from = "[email protected]"; mail($to,$subject,$msg, "From: [email protected]"); } } } } // send msg 1 week before expire $now = time(); $nextweek = $now+(60*60*24*7); if ($data['banner_expire'] <= $nextweek && $data['banner_expire'] >=$now) { $to = $user_email; $from = "From: [email protected]"; $msg = $locale['BB_1'];; $subject = $locale['M'].$user_name.$locale['M_10']; mail($to,$subject,$msg, "From: [email protected]"); } } ?> plz help me. Link to comment https://forums.phpfreaks.com/topic/89096-solved-sending-empty-msg/ Share on other sites More sharing options...
pocobueno1388 Posted February 2, 2008 Share Posted February 2, 2008 We can't tell you whats wrong if you don't tell us the exact problem. Link to comment https://forums.phpfreaks.com/topic/89096-solved-sending-empty-msg/#findComment-456329 Share on other sites More sharing options...
balkan7 Posted February 3, 2008 Author Share Posted February 3, 2008 wrong is when banner expire send to client email empty msg just show subject of msg nothing also, another did my code is corrected ? can someone test it find bug, worng code .... i need this one: 1. check date for banner expire 2. when banner expire, send to mail statistic of that banner. 3. check date for send msg 1 week before expire. soryy for bad english, maybe someone can undestand me and test my code.... Link to comment https://forums.phpfreaks.com/topic/89096-solved-sending-empty-msg/#findComment-456795 Share on other sites More sharing options...
balkan7 Posted February 3, 2008 Author Share Posted February 3, 2008 this variable is worng: $message, must be $msg for that i get empty msg my mistake Link to comment https://forums.phpfreaks.com/topic/89096-solved-sending-empty-msg/#findComment-456917 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.