ballhogjoni Posted April 9, 2008 Share Posted April 9, 2008 Can someone help with this error? syntax error, unexpected T_SL in /home/realfina/public_html/teest.php on line 5 <?php // Generates the top of the page function addHeader($page, $title) { $page .= <<<EOD <html> <head> <title>$title</title> </head> <body> <h1 align="center">$title</h1> EOD; return $page; } // Generates the bottom of the page function addFooter($page, $year, $copyright) { $page .= <<<EOD <div align="center">© $year $copyright</div> </body> </html> EOD; return $page; } // Initialize the page variable $page = ''; // Add the header to the page $page = addHeader($page, 'A Prodecural Script'); // Add something to the body of the page $page .= <<<EOD <p align="center">This page was generated with a procedural script</p> EOD; // Add the footer to the page $page = addFooter($page, date('Y'), 'Procedural Designs Inc.'); // Display the page echo $page; ?> Link to comment https://forums.phpfreaks.com/topic/100377-solved-syntax-error-unexpected-t_sl/ Share on other sites More sharing options...
p2grace Posted April 9, 2008 Share Posted April 9, 2008 Do you have spaces after your EOD; Heredoc doesn't allow there to be any spaces or characters following the semi-colon on an ending heredoc statement. Link to comment https://forums.phpfreaks.com/topic/100377-solved-syntax-error-unexpected-t_sl/#findComment-513362 Share on other sites More sharing options...
ballhogjoni Posted April 10, 2008 Author Share Posted April 10, 2008 Thats what it was...heredocs are touchy little things Link to comment https://forums.phpfreaks.com/topic/100377-solved-syntax-error-unexpected-t_sl/#findComment-513929 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.