graciehz Posted July 20, 2006 Share Posted July 20, 2006 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="" >[color=black]57[/color]</map></P>";[/color][/size]Would love some help. :) Quote Link to comment https://forums.phpfreaks.com/topic/15090-parse-error-parse-error-unexpected-t_constant_encapsed_string/ Share on other sites More sharing options...
Joe Haley Posted July 20, 2006 Share Posted July 20, 2006 $var = "val";any double quotes within double quotes must be escaped with a backslash \$var = ""val"; // bad$var = "\"val"; // good$var = '"val'; // also good Quote Link to comment https://forums.phpfreaks.com/topic/15090-parse-error-parse-error-unexpected-t_constant_encapsed_string/#findComment-60721 Share on other sites More sharing options...
AndyB Posted July 20, 2006 Share Posted July 20, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/15090-parse-error-parse-error-unexpected-t_constant_encapsed_string/#findComment-60736 Share on other sites More sharing options...
wildteen88 Posted July 20, 2006 Share Posted July 20, 2006 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="" ></map></P>HTML;// dont indend the line above !![/code] Quote Link to comment https://forums.phpfreaks.com/topic/15090-parse-error-parse-error-unexpected-t_constant_encapsed_string/#findComment-60896 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.