What on earth is wrong...??

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!

Moderator: General Moderators

Post Reply
bumple
Forum Commoner
Posts: 34
Joined: Thu Jan 08, 2004 4:38 am

What on earth is wrong...??

Post by bumple »

hi, thanks for all your help...but how come this doesnt work?:



<?php
if($logged_in == 0) {
$location = "login_success.php";
header("location: ".$location);
} ?>


I know for a fact on that that $logged_in does equal 0.

this if statement doesnt work either:

<?php
if($logged_in == 0) {
header("Location:login_success.php");
} ?>


What could possibly be wrong? Thanks a lot!

-bumple.
User avatar
devork
Forum Contributor
Posts: 213
Joined: Fri Aug 08, 2003 6:44 am
Location: p(h) developer's network

Post by devork »

the same script worked for me!

compare $logged_in with string variable.

$logged_in=="logged_in"
bumple
Forum Commoner
Posts: 34
Joined: Thu Jan 08, 2004 4:38 am

Post by bumple »

I don't quite understand what you mean?
Nay
Forum Regular
Posts: 951
Joined: Fri Jun 20, 2003 11:03 am
Location: Brisbane, Australia

Post by Nay »

Instead of doing all that, check for $logged_in first by outputting it.

-Nay
Post Reply