Search the Community
Showing results for tags 'booleanvariables'.
-
So I'm just learning PHP and MySQL for the first time, and I've been doing really well. I have a lot of experience with HTML and C++ so a lot of concepts are very familiar. I'm currently using if { to determine whether or not an HTML form field has any data in it or not. If either of two fields are empty, it echoes a warning to the user and re-prints the form on the resulting page. Here's a link to a pastebin of what I currently have. Note that I have tried $form_output both as 'true' and 'false' & also just as plain true and false (no quotes). Both seem to fail when I reach the if statements. Even if the $subject or $body variables are false, it still starts sending the emails in the if ($output_form = false) section. So my question is partially - does PHP recognize true and false without quotes as boolean variables? Or does it just think they are plain text? I figured that because they have no quotes, if it didn't recognize them as special terms it would crash the script at that point. I need to learn how to use a PHP debugger on Linux, so if someone could help me with that too, that'd be great. I probably wouldn't even have to ask this question because the debugger would have shown me what the script is actually doing. My other question is, the book I'm learning from shows the script going in and out of the <php? tags, back to HTML, then back into <php? to close the script (at the bottom of the above link). Is that accepted syntax or is that incorrect? Thanks a lot in advance for your help!! Much appreciated.
- 9 replies
-
- booleanvariables
- if
-
(and 1 more)
Tagged with: