PDA

View Full Version : Need help getting this feature to work.



ClubTime
03-09-2006, 12:56 PM
Okay i was following the Techtuts user system but decided to edit it Loads! but then i got into a problem i wanted the page to open in a new page instead of redirecting to the old one. Which was a success. then on the new page at the top i put as they say to..


<?
ob_start();
include("config.php");
if ($logged[username])
{
echo("You are logged in");
}
else
{
echo("You are not logged in");
}
?>


Then i add my coded template below. (its in html)

Then when i login and go to this page i get the messgae 'Your are logged in' then the template shows.

But if i got to that page without loging in i get 'you are not logged in' but the template stil shows.

So.. this is where you lot come in.

I want it so that it doesnt show 'you are logged in' i want it just to show the template and if your not logged in i dont want it to show the template, just the message 'you are not logged in'.

I really need help on this a.s.a.p

+rep for anyone that trys :D Thanks

Chris

:Blob
03-09-2006, 01:11 PM
<?
ob_start();
include("config.php");
if ($logged[username])
{
echo("You are logged in");
}
else
{
echo("You are not logged in");
}
?>
Enter under here, it shows it anyway

Try this:


<?PHP
ob_start();
include("config");
if ($logged[username])
{
?>
Site here
<?PHP
} else {
echo ("You are not logged in");
}
?>

ClubTime
03-09-2006, 01:21 PM
:O Thanks alot wokred like a charm. Except there was one error lol you put

inlcude("config");

instead of include("config.php");

Thanks alot +rep

EDIT: Sorry need to spread :(

:Blob
03-09-2006, 01:50 PM
Ahh yes.. i always do that

Want to hide these adverts? Register an account for free!