PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
The first line of code, in more plain language says:
If the session variable user is set OR if it's set but false... do something.
The second line of code says:
If the get variable e is set AND that variable equals 1... do something.
What both of those lines are doing are evaluating a variable and if the variables meet the conditions, the IF statement will return TRUE and execute whatever comes between the brackets { } after the IF statement.
Given that there is a PHP closing tag after the opening bracket { I'm guessing it will spit out some html code and then when that's done, there will be another php opening tag and then a closing bracket }.
It would be instructional for you to go read about IF statments in php AND logical operators in PHP. There's enough material out there that I don't need to recreate it here.
if (!isset($_SESSION['user']) || $_SESSION['user'] == false) {
Because if it is not set then the equals false comparison won't be made, so there's no reason to check if it is set.
EDIT: Yep.
Last edited by AbraCadaver on Tue May 25, 2010 3:46 pm, edited 1 time in total.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
No, it's perfect. See below. The parse error must be originating elsewhere. What is the message?
[syntax]
|---------------------closed here-----------------------|
| |---closed here---| |
if (!isset($_SESSION['user']) || $_SESSION['user'] == false) {
[/syntax]
Jonah Bron wrote:No, it's perfect. See below. The parse error must be originating elsewhere. What is the message?
[syntax]
|---------------------closed here-----------------------|
| |---closed here---| |
if (!isset($_SESSION['user']) || $_SESSION['user'] == false) {
[/syntax]
wrong timing AbraCadaver just edited his post and fixed it