What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP login system help needed

PHP login system help needed
Author: Message:
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: PHP login system help needed
You are wrong. My line isn't redundant at all.

If the var is empty, it can indeed not equal Nathan. When the var is empty, "empty($_SESSION['Nathan'])" will be true, so the other part of the line will not be evaluated.

However, if there is a value, "empty($_SESSION['Nathan'])" is false, and then it checks if "$_SESSION['Nathan'] != "Nathan"". When that is true, the $_SESSION['Nathan'] is appearantly not what we expected, en we should stop processing.

code:
if (!isset($_SESSION['Nathan']) && $_SESSION['Nathan'] != "Nathan")
is really wrong (or, not what you meant). If the session var was not set, the first part will be true, so the second part will also be evaluated (to check if true && true). However, if it is not set it can never equal "Nathan".

Imagine:
$_SESSION['Nathan'] = "J-Thread";

Then "isset($_SESSION['Nathan'])" is true, so "!isset($_SESSION['Nathan'])" is false. Then the whole statement will be false, so the "die(...)" will not be executed. However, this was obviously not what you want!

This post was edited on 10-14-2006 at 05:01 PM by J-Thread.
10-14-2006 05:00 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
PHP login system help needed - by Nathan on 10-13-2006 at 09:37 PM
RE: A bit of help please :p - by andrewdodd13 on 10-14-2006 at 09:43 AM
RE: RE: A bit of help please :p - by J-Thread on 10-14-2006 at 11:12 AM
RE: RE: RE: A bit of help please :p - by andrewdodd13 on 10-14-2006 at 12:58 PM
RE: PHP login system help needed - by -dt- on 10-14-2006 at 11:31 AM
RE: PHP login system help needed - by J-Thread on 10-14-2006 at 05:00 PM
RE: PHP login system help needed - by Lou on 10-14-2006 at 05:27 PM
RE: PHP login system help needed - by -dt- on 10-14-2006 at 05:36 PM
RE: PHP login system help needed - by J-Thread on 10-14-2006 at 06:21 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On