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 Link to comment https://forums.phpfreaks.com/topic/287522-simple-cms-function-not-working/ 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? Link to comment https://forums.phpfreaks.com/topic/287522-simple-cms-function-not-working/#findComment-1474963 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. Link to comment https://forums.phpfreaks.com/topic/287522-simple-cms-function-not-working/#findComment-1475051 Share on other sites More sharing options...
boompa Posted April 5, 2014 Share Posted April 5, 2014 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 Link to comment https://forums.phpfreaks.com/topic/287522-simple-cms-function-not-working/#findComment-1475052 Share on other sites More sharing options...
Ch0cu3r Posted April 5, 2014 Share Posted April 5, 2014 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; Link to comment https://forums.phpfreaks.com/topic/287522-simple-cms-function-not-working/#findComment-1475053 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! Link to comment https://forums.phpfreaks.com/topic/287522-simple-cms-function-not-working/#findComment-1475127 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.