Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

T_CONSTANT_ENCAPSED_STRING error 1

Status
Not open for further replies.

jasek78

Programmer
Nov 5, 2001
298
US
I'm getting a unexpected T_CONSTANT_ENCAPSED_STRING error. I can't see what the issue is... anyone able to help???

Jason

Code:
$msg = "";
foreach($_POST as $key => $value){
   if ($value != "") {
      $msg .= "^ ". $key ." = ". $value "<br/>\n";  //this is the line that is reported.
   }
}
 
I don't see an error there, either -- but this is not unexpected. When PHP says it has a parse error or a string encapsulation error on line X, that does not mean the typo will appear on line X. It means that when the PHP interpreger got to line X, the code no longer makes sense to it. The actual typo could be many lines before the reported line.




Want the best answers? Ask the best questions! TANSTAAFL!
 
You are missing a period here:

Code:
  $msg .= "^ ". $key ." = ". $value [red]>>.<<[/red] "<br/>\n";




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thank you VERY much Vacunita - I stared at that line all day saturday and didn't see it...

Jason
 
Neither did I the first time around. But glad I could help.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top