User defined tag makes page turn white
Posted: Sun Oct 21, 2007 9:23 am
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:
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.
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 am quite new to PHP and the cms so feel free to explain as if I were 10 years old.