Old 17-08-2006, 11:45   #1 (permalink)
riat_sila
Design on ice
 
riat_sila's Avatar
 
Join Date: Jun 2005
Location: Bracknell, UK
Posts: 167
Send a message via AIM to riat_sila Send a message via MSN to riat_sila Send a message via Yahoo to riat_sila
Gay session variables

I'm pretty new to PHP and all that crap, but for some reason I'm having problems storing session variables (yes, I have started a session). Here's some example code:

Code:
if(isset($_POST['Submit'])) { if ($_POST['username'] == ADMIN_USERNAME && $_POST['password'] == ADMIN_PASSWORD) { $_SESSION['AdminLogged'] == true; header('Location: '. $this->mReturnPage); exit; } else $this->mLoginMessage = "<br />Login failed. Please enter the correct user and pass."; }

For some reason when I execute this by entering the correct details and posting the form, the session variable isn't stored and so it returns to the login page??
  Reply With Quote
Old 17-08-2006, 14:03   #2 (permalink)
dtrenz
blam blam
 
dtrenz's Avatar
 
Join Date: Aug 2006
Location: ann arbor, mi usa
Posts: 527
i hesitate in helping you based on the title of this thread...


but your problem is this:
Code:
$_SESSION['AdminLogged'] == true;

"==" is a boolean comparison.
"=" is a variable assignment.
  Reply With Quote
Old 17-08-2006, 14:13   #3 (permalink)
datahound
Spare Parts
 
datahound's Avatar
 
Join Date: Jan 2005
Location: Bracknell Forest
Posts: 4,717
Quote:
Originally Posted by riat_sila
I'm pretty new to PHP and all that crap,


When did gay become a description that can be used for bad things, I have heard this as the case elsewhere.

Yes for camp or girly. Celebrity magazines are gay. Big Brother is gay. Tom Cruise is gay.

Would you say nigger session variables?
__________________
  Reply With Quote
Old 17-08-2006, 14:25   #4 (permalink)
dtrenz
blam blam
 
dtrenz's Avatar
 
Join Date: Aug 2006
Location: ann arbor, mi usa
Posts: 527
isset($_SESSION['Gay']);
  Reply With Quote
Old 17-08-2006, 16:43   #5 (permalink)
d*d
Senior Member
 
d*d's Avatar
 
Join Date: Oct 2004
Location: Bristol
Posts: 3,155
considering gay used to mean happy and jovial I can't see why it now shouldn't be used in another way, stop bieng so pc - it's gay
  Reply With Quote
Old 17-08-2006, 19:48   #6 (permalink)
sub
Shitcasket™
 
sub's Avatar
 
Join Date: Jul 2005
Location: Brighton
Posts: 3,901
Send a message via MSN to sub Send a message via Skype™ to sub
Queer.
__________________
  Reply With Quote
Old 17-08-2006, 20:32   #7 (permalink)
datahound
Spare Parts
 
datahound's Avatar
 
Join Date: Jan 2005
Location: Bracknell Forest
Posts: 4,717
Poofter
__________________
  Reply With Quote
Old 18-08-2006, 05:15   #8 (permalink)
Luke Redpath
Barney army!
 
Luke Redpath's Avatar
 
Join Date: Mar 2003
Location: London
Posts: 696
Not just the use of equality instead of assignment, but you'll probably want to call session_write_close() before you send you're header and exit.

http://uk2.php.net/manual/en/functio...rite-close.php
__________________
Luke Redpath .::. Software Engineer .::. Reevoo - Real Reviews From Real Customers
  Reply With Quote
Old 18-08-2006, 17:22   #9 (permalink)
riat_sila
Design on ice
 
riat_sila's Avatar
 
Join Date: Jun 2005
Location: Bracknell, UK
Posts: 167
Send a message via AIM to riat_sila Send a message via MSN to riat_sila Send a message via Yahoo to riat_sila
Quote:
Originally Posted by datahound
When did gay become a description that can be used for bad things, I have heard this as the case elsewhere.

Yes for camp or girly. Celebrity magazines are gay. Big Brother is gay. Tom Cruise is gay.

Would you say nigger session variables?

Nah session variables are white...

But yeah, cheers for the help - I knew it was something retarded that I'd done
  Reply With Quote
Old 19-08-2006, 06:40   #10 (permalink)
mgpwr
with a hint of lemon
 
mgpwr's Avatar
 
Join Date: Aug 2006
Location: Hull
Posts: 478
no comment
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8