mmerril1 Posted January 6, 2009 Share Posted January 6, 2009 Hi again cannot figure out why this line of code with not work Parse error: syntax error, unexpected T_SL error on line 3 if ($_POST[web] != ""){ $title = <<<TEST <a class="active" href="http://$_POST[web]" target="_blank">$_POST[bname]</a><br> TEST; } else { $title = <<<TEST <font class="nosite">$_POST[bname]</font><br> TEST; } Quote Link to comment https://forums.phpfreaks.com/topic/139636-heredoc-stringproblems/ Share on other sites More sharing options...
DarkWater Posted January 6, 2009 Share Posted January 6, 2009 I get no syntax error from that code. Quote Link to comment https://forums.phpfreaks.com/topic/139636-heredoc-stringproblems/#findComment-730590 Share on other sites More sharing options...
PFMaBiSmAd Posted January 6, 2009 Share Posted January 6, 2009 T_SL << bitwise operators That error is associated with a bitshift and the only way you would be getting that error is if your actual code only had two << in it. Are you sure of what your actual code being executed is? Quote Link to comment https://forums.phpfreaks.com/topic/139636-heredoc-stringproblems/#findComment-730596 Share on other sites More sharing options...
mmerril1 Posted January 6, 2009 Author Share Posted January 6, 2009 I am so confused right now... I want to make a string var that contains html code in it so I can put it in a txt file. this code here is taking forum inputs and putting it in the correct format. I think it doesnt like the html code. Quote Link to comment https://forums.phpfreaks.com/topic/139636-heredoc-stringproblems/#findComment-730618 Share on other sites More sharing options...
mmerril1 Posted January 6, 2009 Author Share Posted January 6, 2009 so is it like a document type problem? Quote Link to comment https://forums.phpfreaks.com/topic/139636-heredoc-stringproblems/#findComment-730622 Share on other sites More sharing options...
PFMaBiSmAd Posted January 6, 2009 Share Posted January 6, 2009 It's a php syntax problem. If that is the code in the file generating the error, then there is something wrong with the <<< that php thinks it is just a <<. Try deleting and re-entering the <<< Quote Link to comment https://forums.phpfreaks.com/topic/139636-heredoc-stringproblems/#findComment-730631 Share on other sites More sharing options...
mmerril1 Posted January 6, 2009 Author Share Posted January 6, 2009 Strange that might have been the problem! I moved down a line and same problem Lets see if it works! Quote Link to comment https://forums.phpfreaks.com/topic/139636-heredoc-stringproblems/#findComment-730639 Share on other sites More sharing options...
mmerril1 Posted January 6, 2009 Author Share Posted January 6, 2009 cool I got past all my heredoc string problems. Thank you so much Quote Link to comment https://forums.phpfreaks.com/topic/139636-heredoc-stringproblems/#findComment-730640 Share on other sites More sharing options...
sasa Posted January 6, 2009 Share Posted January 6, 2009 you just remove space after TEXT Quote Link to comment https://forums.phpfreaks.com/topic/139636-heredoc-stringproblems/#findComment-730654 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.