MasterACE14 Posted June 30, 2008 Share Posted June 30, 2008 I have a custom function to simply 'kill' the executing script if there is a error and report a error message but I am receiving this error just by creating the function, not even calling it. Parse error: syntax error, unexpected $end in /home/ace/public_html/conflictingforces/functions.php on line 211 the function: <?php function cf_error($message) { // display a error $error_message = <<<_MESSAGE <center class="box-bad"> {$message} </center> _MESSAGE; die($error_message); } // line 211 any ideas? Regards ACE Link to comment https://forums.phpfreaks.com/topic/112537-solved-end-error-custom-error-report-function/ Share on other sites More sharing options...
ratcateme Posted June 30, 2008 Share Posted June 30, 2008 you need to change _MESSAGE; to _MESSAGE; so it is the first part of the line at the moment the string is not ending. you should try using an editor like phpDesigner that will show errors like this also why don't you just use " instead of <<< it works just the same. Scott. Link to comment https://forums.phpfreaks.com/topic/112537-solved-end-error-custom-error-report-function/#findComment-577888 Share on other sites More sharing options...
MasterACE14 Posted June 30, 2008 Author Share Posted June 30, 2008 yep thats working now. Thanks why don't you just use " instead of <<< it works just the same. works the same, but makes everything much simpler to work with instead of having to escape quotes and special characters all the time when including variables and arrays. Regards ACE Link to comment https://forums.phpfreaks.com/topic/112537-solved-end-error-custom-error-report-function/#findComment-577890 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.