shadrxninga Posted March 23, 2011 Share Posted March 23, 2011 echo "<img src="logo.gif" alt="Angry face" width="32" height="32" />"; This is giving an error like this Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/scswc188/public_html/admin.php on line 21 I think it is because of the "" in the html but I don't know how do fix it. Thanks Link to comment https://forums.phpfreaks.com/topic/231460-html-in-php/ Share on other sites More sharing options...
darkfreaks Posted March 23, 2011 Share Posted March 23, 2011 try: echo"<img src=\"logo.gif\" alt=\"Angry Face\" height=\"32\" width=\"32\">"; Link to comment https://forums.phpfreaks.com/topic/231460-html-in-php/#findComment-1191164 Share on other sites More sharing options...
Krash Posted March 23, 2011 Share Posted March 23, 2011 This should also work - echo '<img src="logo.gif" alt="Angry face" width="32" height="32" />'; Link to comment https://forums.phpfreaks.com/topic/231460-html-in-php/#findComment-1191166 Share on other sites More sharing options...
QuickOldCar Posted March 23, 2011 Share Posted March 23, 2011 or even this could work echo "<img src='logo.gif' alt='Angry face' width='32' height='32' />"; Link to comment https://forums.phpfreaks.com/topic/231460-html-in-php/#findComment-1191167 Share on other sites More sharing options...
cs.punk Posted March 23, 2011 Share Posted March 23, 2011 You have to either escape the " with a backslash \ or use single quotes... Link to comment https://forums.phpfreaks.com/topic/231460-html-in-php/#findComment-1191183 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.