mmerril1 Posted January 5, 2009 Share Posted January 5, 2009 Hey everyone I am new here and new to php I am having trouble with heredoc strings I think it is because of the special characters I'm using. Anyways this is what it looks like Parse error: syntax error, unexpected T_SL on line 48 code starts on line 46 if ($_POST[web] != ""){ $title = <<<TEST <a class="active" href="http://$_POST[web]" target="_blank">$_POST[bname]</a><br> TEST; } esle { $title = <<<TEST <font class="nosite">$_POST[bname]</font><br> TEST; } So am I even allowed to put the html stuff in there ? Is that wats messing it up? Thank you for the help. Link to comment https://forums.phpfreaks.com/topic/139541-heredoc-string-problems/ Share on other sites More sharing options...
GingerRobot Posted January 5, 2009 Share Posted January 5, 2009 Err, no. Typo: } esle { Should be: } else { Incidentally, what editor are you using to write your code? Anything with syntax highlighting would have made that easier to spot. Link to comment https://forums.phpfreaks.com/topic/139541-heredoc-string-problems/#findComment-729925 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.