avelonz Posted July 31, 2010 Share Posted July 31, 2010 Hey guys. I'm having a problem with my code and I can not seem to understand what's wrong.. My suspicion is that the $string gets too big or something.. but I'm not quite sure. $subject = $_GET['sub']; $message = explode("|", $_GET['msg']); $sendto = "email"; $sendfrom = "email"; foreach($message as $user){ $user = explode(":", $user); $activity1 = base64_decode($user[0]); $activity2 = base64_decode($user[1]); $activity0 = base64_decode($user[2]); $string .= "Activity0: " . $activity0 . "<br>" . "Activity1: " . $activity1. "<br>" . "Activity2: " . $activity2 . "<br>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br>"; } if($subject && $activity1 && $activity2 && $activity0){ $header = 'Content-type: text/html; charset=iso-8859-1' . "\r\n" . 'From: ' . $sendfrom . "\r\n"; mail($sendto, $subject, "<html>" . "<center>" . "<br><br><br>" . " - - - " . "Program logged this activity" . " - - - " . "<br>" . $string . "<br>" . "<b> - meh -</br></center></html>", $header); } else { echo "Failed?"; } So the main point is that a program sends the required information to the php script and it proceeds by splitting it up and showing it in an organized way.. and then sends it to an email. This works flawless until some point where the message gets too big(?) and it'll do else { echo "Failed?"; } instead... Do you guys have any idea what's wrong? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/209401-string-is-too-big-i-can-not-see-what-my-problem-is/ Share on other sites More sharing options...
jcbones Posted July 31, 2010 Share Posted July 31, 2010 IT returns failed, because one of these: if($subject && $activity1 && $activity2 && $activity0) Returns as false. Quote Link to comment https://forums.phpfreaks.com/topic/209401-string-is-too-big-i-can-not-see-what-my-problem-is/#findComment-1093413 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.