Newbie "Logical" Observation: Get your sytax Correct!!!!!!! |
[eluser]featureBlend[/eluser]
Im on a local Apache 2.06 / PHP 5.2.6 / MY SQL 5+ Environment A simple logical observation and explanation ---> I am not using short tags and the tutes that Derek posted do, so if you are in the same position as me then read on.. I had done everything according to the tute, but when i pressed the submit button in the comments_view there was no response..Heres the files BEFORE i figured it out: 1. blog.php (Front Controller) Code: <?php 2. comment_view.php (View file for comment page) Code: <html> No response from the Submit button from the above code..Why? I knew it was something with my syntax in one of the files. Was it the <form> tag in the comments_view (but i called the form helper class from the controller so it should handle the request right?, RIGHT), or some other syntax error. See below: Code: <html> I failed to add the "echo" STATEMENT before (1) form_open and (2) form_hidden in my comments_view file. What is the echo statement? In flat files the syntax would be: Code: void echo (string argument [,...string argumentN]) The echo() statement operates similarily to print(), except for two differences. 1 - It cannot be used as a part of a complex expression because it returns void() 2 - echo() is capable of outputting multiple strings (see below) For example: Code: <?php Try to develop good habits and "familiarize" yourself with flat php syntax as well....
[eluser]GSV Sleeper Service[/eluser]
Not sure what point you're trying to make here.. a quick glimpse at the documentation would have told you that you need to echo the response from the form helpers.
[eluser]Nick Husher[/eluser]
Long syntax is to short syntax as "<?php echo ${YOUR_EXPRESSION} ?>" is to "<?=${YOUR_EXPRESSION} ?>". I'm not sure I see the issue. The syntax error was yours.
[eluser]featureBlend[/eluser]
@Nick, GSV - point noted, yes I agree, the syntax error was mine. The title to this post should have read "Newbie Syntax Mistake: Yadda yadda yadda" - or something to that effect. The only reason for the post was to contribute to newbies who might learn from my "foolish" mistakes.. I did read a post earlier about a CI user who took 2 weeks to see that little "Table of Contents" tab on the user guide. |
Welcome Guest, Not a member yet? Register Sign In |