Jump to content


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


Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING

Recommended Posts

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in F:\Program Files\Apache Group\Apache2\htdocs\ministarsnetwork2\designs\screws.inc.php on line 54

[size=8pt][color=black]52[/color][color=purple]$menu2[/color] [color=blue]= "<P align=left>
[color=black]53[/color]<img name=phone_item_equip_flat src=phone_item_equip_flat.png width=110 height=47 border=0 usemap=#m_phone_item_equip_flat alt=""><map name=m_phone_item_equip_flat>
[color=black]54[/color]<area shape=poly coords=80,27,81,22,84,17,89,14,95,12,101,14,106,17,109,22,110,27,109,33,106,38,101,41,95,43,89,41,84,38,81,33,80,27,80,27 href=javascript:; alt="" >
[color=black]55[/color]<area shape=poly coords=39,27,40,20,44,15,49,11,55,10,62,11,67,15,71,20,72,27,71,33,67,39,62,42,55,43,49,42,44,39,40,33,39,27,39,27 href=javascript:; alt="" >
[color=black]56[/color]<area shape=poly coords=-1,27,0,21,4,16,9,13,15,12,21,13,26,16,30,21,31,27,30,34,26,39,21,42,15,43,9,42,4,39,0,34,-1,27,-1,27 href=javascript:; alt="" >

Would love some help.  :)

Share this post

Link to post
Share on other sites
$var = "val";

any double quotes within double quotes must be escaped with a backslash \

$var = ""val"; // bad
$var = "\"val"; // good
$var = '"val'; // also good

Share this post

Link to post
Share on other sites
Joe's response tells you why you got the error - and how to avoid them in future.

The quick solution to the specific problem you posted would be to change alt="" to alt= '' in each case, i.e. change those " to ' and they won't 'clash' with the " you used to delimit what you wanted echo'd.

Share this post

Link to post
Share on other sites
I would suggest you use HEREDOC if you have alot of HTML like so:
[code=php:0]$menu = <<<HTML
<P align="left">
<img name="phone_item_equip_flat" src="phone_item_equip_flat.png" width="110" height="47" border="0" usemap="#m_phone_item_equip_flat" alt=""><map name="m_phone_item_equip_flat">
<area shape="poly" coords="80,27,81,22,84,17,89,14,95,12,101,14,106,17,109,22,110,27,109,33,106,38,101,41,95,43,89,41,84,38,81,33,80,27,80,27" href="javascript:void;" alt="" >
<area shape="poly" coords="39,27,40,20,44,15,49,11,55,10,62,11,67,15,71,20,72,27,71,33,67,39,62,42,55,43,49,42,44,39,40,33,39,27,39,27" href="javascript:void;" alt="" >
<area shape="poly" coords="-1,27,0,21,4,16,9,13,15,12,21,13,26,16,30,21,31,27,30,34,26,39,21,42,15,43,9,42,4,39,0,34,-1,27,-1,27" href="javascript:void;" alt="" >
// dont indend the line above !![/code]

Share this post

Link to post
Share on other sites


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.