User defined tag makes page turn white

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
wournos
Forum Members
Forum Members
Posts: 40
Joined: Sat Jun 23, 2007 6:23 pm

User defined tag makes page turn white

Post 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.
wournos
Forum Members
Forum Members
Posts: 40
Joined: Sat Jun 23, 2007 6:23 pm

Re: User defined tag makes page turn white

Post by wournos »

I still need help with this. I have been through the Wiki but it doesn't help at all.
Anyone?
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: User defined tag makes page turn white

Post by Nullig »

Why don't you use the FrontEndUsers and CustomContent modules?
They will accomplish what you want without the need for UDTs.

Nullig
Post Reply

Return to “CMSMS Core”