Jump to content

Parse error: syntax error, unexpected T_VARIABLE


Mod-Jay

Recommended Posts

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'].";
}

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.

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. :P

 

Anyway, glad it's working.

 

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!!!!!!!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.