Incomsys Posted April 4, 2014 Share Posted April 4, 2014 Hello, I'd done this tut: http://css-tricks.com/php-for-beginners-building-your-first-simple-cms/. But i ca'nt get it to work wright. i've attached the files. Can anyone tell why it isn't working. I'm a beginner in PHP. thanks display.php simpleCMS.php Quote Link to comment Share on other sites More sharing options...
Ch0cu3r Posted April 4, 2014 Share Posted April 4, 2014 Can you explain the problems you are having? Any errors? How are you testing/running the code? Quote Link to comment Share on other sites More sharing options...
Incomsys Posted April 5, 2014 Author Share Posted April 5, 2014 It says: Parse error: syntax error, unexpected '<<' (T_SL) in C:\wamp\www\Tutorials\Intermediate - Simple CMS\simpleCMS.php on line 17 But i just copied the heredoc syntax. I'm running wamp. Quote Link to comment Share on other sites More sharing options...
boompa Posted April 5, 2014 Share Posted April 5, 2014 (edited) The end delimiter of a heredoc *must* start at the first column. Note the big red box in the documentation: http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc Edited April 5, 2014 by boompa Quote Link to comment Share on other sites More sharing options...
Solution Ch0cu3r Posted April 5, 2014 Solution Share Posted April 5, 2014 (edited) Your heredoc syntax is wrong. It currently like this $somevar = <<<delimiter // some comment here ... some text/html ... delimiter; There should not be anything directly after the opening heardoc delimiter (remove the comment) Also nothing should be before the closing heardoc delimiter (including tables/spaces). The closing delimiter should start from the first character of the next line. Your heredoc syntax should be like this $somevar = <<<delimiter ... some text/html ... delimiter; Edited April 5, 2014 by Ch0cu3r Quote Link to comment Share on other sites More sharing options...
Incomsys Posted April 6, 2014 Author Share Posted April 6, 2014 There where some other sloppy things, but i solved it. Thanks! 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.