Mod-Jay Posted March 21, 2011 Share Posted March 21, 2011 The line the Error is : $result = mail("" . $formatted_number. "", "" . $subject . "", "". $message .""); In the code: if (array_key_exists($carrier, $carriers)) { $correctCarrier = $carriers[$carrier]; $i = 0; while($i < $_POST['amount']){ $i++; $formatted_number = $to.$correctCarrier $result = mail("" . $formatted_number. "", "" . $subject . "", "". $message .""); $resultmsg = "Your Message Has been sent to the number ". $formatted_number. ".<br>"; } Echo $result; Echo $resultmsg; Echo "You have Sent $_POST['amount'] Messages to the number $_POST['to']."; } Link to comment https://forums.phpfreaks.com/topic/231329-parse-error-syntax-error-unexpected-t_variable/ Share on other sites More sharing options...
gizmola Posted March 21, 2011 Share Posted March 21, 2011 Mod-Jay, The problem is that line before is missing the ';' at the end. However, I have to ask why are you concatenating a bunch of empty strings there? There is no reason for that, just pass your parameters in there... php does typcasting on the fly. Link to comment https://forums.phpfreaks.com/topic/231329-parse-error-syntax-error-unexpected-t_variable/#findComment-1190574 Share on other sites More sharing options...
Mod-Jay Posted March 21, 2011 Author Share Posted March 21, 2011 Uhm? Someone must be seeing different because theres a ';' there Link to comment https://forums.phpfreaks.com/topic/231329-parse-error-syntax-error-unexpected-t_variable/#findComment-1190576 Share on other sites More sharing options...
Maq Posted March 21, 2011 Share Posted March 21, 2011 Uhm? Someone must be seeing different because theres a ';' there Yes, you are seeing something different. This line is missing ';': $formatted_number = $to.$correctCarrier Link to comment https://forums.phpfreaks.com/topic/231329-parse-error-syntax-error-unexpected-t_variable/#findComment-1190579 Share on other sites More sharing options...
Mod-Jay Posted March 21, 2011 Author Share Posted March 21, 2011 Well he didnt say what line and i didnt bother to look at the others, Thanks! Link to comment https://forums.phpfreaks.com/topic/231329-parse-error-syntax-error-unexpected-t_variable/#findComment-1190581 Share on other sites More sharing options...
Maq Posted March 21, 2011 Share Posted March 21, 2011 Well he didnt say what line and i didnt bother to look at the others, Thanks! You said the line causing the error was: $result = mail("" . $formatted_number. "", "" . $subject . "", "". $message .""); and Gizmola said: The problem is that line before is missing the ';' at the end. which is the line that I just posted. Anyway, glad it's working. Link to comment https://forums.phpfreaks.com/topic/231329-parse-error-syntax-error-unexpected-t_variable/#findComment-1190583 Share on other sites More sharing options...
gizmola Posted March 21, 2011 Share Posted March 21, 2011 Maq deserves the php "e-knight" badge for defending my honor. Thanks amigo But back to the important part of my reply, which is -- please for all that is good and right in the world of php development, lose all the null strings!!!!!!!! Link to comment https://forums.phpfreaks.com/topic/231329-parse-error-syntax-error-unexpected-t_variable/#findComment-1190585 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.