dsaba Posted April 9, 2007 Share Posted April 9, 2007 give me this error in parse error: Parse error: parse error, unexpected T_SL i'm using heredoc syntax like this: <?php /////////DISPLAY END OF RESULT TABLE $endoftable = <<<ENDOFTABLE <!-- end of table --> <tr valign="top"> <td height="29" colspan="5" valign="bottom" class="style2"><img src="/images/trans.png" width="9" height="9" /> Translated file <img src="/images/active.png" width="9" height="9" /> Active <img src="/images/halfactive.png" width="9" height="9" /> Half-Active <img src="/images/inactive.png" width="9" height="9" /> Inactive</td> </tr> </form> </table></td> </tr> <!-- stop --> ENDOFTABLE; echo $endoftable; mysql_close(); ?> any idea what is causing the error?-thanks Quote Link to comment Share on other sites More sharing options...
btherl Posted April 9, 2007 Share Posted April 9, 2007 You appear to have a tab after your heredoc delimiter Edit: It's in both the start and end lines.. looks like both of them need to go to satisfy heredoc's strict syntax. Quote Link to comment Share on other sites More sharing options...
dsaba Posted April 9, 2007 Author Share Posted April 9, 2007 <?php /////////DISPLAY END OF RESULT TABLE $endoftable = <<<ENDOFTABLE <!-- end of table --> <tr valign="top"> <td height="29" colspan="5" valign="bottom" class="style2"><img src="/images/trans.png" width="9" height="9" /> Translated file <img src="/images/active.png" width="9" height="9" /> Active <img src="/images/halfactive.png" width="9" height="9" /> Half-Active <img src="/images/inactive.png" width="9" height="9" /> Inactive</td> </tr> </form> </table></td> </tr> <!-- stop --> ENDOFTABLE; echo $endoftable; mysql_close(); ?> this still doesnt work Quote Link to comment Share on other sites More sharing options...
btherl Posted April 9, 2007 Share Posted April 9, 2007 That's because you haven't removed the tab. A tab is an invisible character that appears when you press the tab key on the keyboard. Move the cursor to immediately after your ENDOFTABLE marker and hit "del", and that should delete the tab. Do the same for the end of the heredoc and the start. Quote Link to comment Share on other sites More sharing options...
MadTechie Posted April 9, 2007 Share Posted April 9, 2007 i have a question on heredoc's can i use them for a whole block of html & code something like this $mytest= <<<TESTING This is a test <? echo "Hello {test['var']}" ?> blar ENDOFTABLE; Quote Link to comment Share on other sites More sharing options...
dsaba Posted April 9, 2007 Author Share Posted April 9, 2007 thanks for the help btherl! I'm always surprised on new things I had no clue about, as I thought i knew what a tab was, I guess not. Now I have to take "invisible" items into account when debugging errors. Great Quote Link to comment 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.