confusio
07-08-2006, 02:07 AM
Hi,
Due to bandwith problems i decided to make my downloads only accessible for registered members so i installed a simple user system.After i finished installing it everythings fine then they told me to add a small code to the top of every page i want protected for members only,the code was this :
<?
ob_start();
include("config.php");
if ($logged[username])
{
echo("You are logged in");
}
else
{
echo("You are not logged in");
}
?>
Since I wasn't sure on how to echo the downloads page i decided the use Include and did like this :
<?php
ob_start();
include("http://myurl.com/config.php");
if ($logged[username])
{
include("http://myurl.com/downloads.php");
}
else
{
include("http://myurl.com/login.php");
}
?>
My downloads folder is in a sub folder so I would have to unclude the whole url,idk what seems to be the problem.Is their anyway to get it to work by checking if the user is logged in and insted of echoing the page maybe continue loading it? If not logged in send them to the main login page?anyway
thanks
Mick
Due to bandwith problems i decided to make my downloads only accessible for registered members so i installed a simple user system.After i finished installing it everythings fine then they told me to add a small code to the top of every page i want protected for members only,the code was this :
<?
ob_start();
include("config.php");
if ($logged[username])
{
echo("You are logged in");
}
else
{
echo("You are not logged in");
}
?>
Since I wasn't sure on how to echo the downloads page i decided the use Include and did like this :
<?php
ob_start();
include("http://myurl.com/config.php");
if ($logged[username])
{
include("http://myurl.com/downloads.php");
}
else
{
include("http://myurl.com/login.php");
}
?>
My downloads folder is in a sub folder so I would have to unclude the whole url,idk what seems to be the problem.Is their anyway to get it to work by checking if the user is logged in and insted of echoing the page maybe continue loading it? If not logged in send them to the main login page?anyway
thanks
Mick