Page 1 of 1

User defined tag makes page turn white

Posted: Sun Oct 21, 2007 9:23 am
by wournos
Hi,

I am currently working on password protecting some of my site pages and found that I have to use User Defined Tags to be able to add PHP to my cms pages. I created a tag called pass_protect_files and added the following code:

Code: Select all

// starts sessionen
session_start();

// if there's no session with the right username or password, the login page is shown
if (!isset($_SESSION["login"]) || $_SESSION["login"] !== true) {
header("Location: /db_files/login.php");
exit;
}

// If the session exist, login was successful and the protected pages are shown

I used the tag (with squiggly brackets) and added it into the appropriate template. But when I preview the pages in the page menu they are all white. Why is that?

I am quite new to PHP and the cms so feel free to explain as if I were 10 years old.

Re: User defined tag makes page turn white

Posted: Tue Oct 23, 2007 5:29 pm
by wournos
I still need help with this. I have been through the Wiki but it doesn't help at all.
Anyone?

Re: User defined tag makes page turn white

Posted: Tue Oct 23, 2007 6:06 pm
by Nullig
Why don't you use the FrontEndUsers and CustomContent modules?
They will accomplish what you want without the need for UDTs.

Nullig