a big problem and a small problem with template system
Posted: Fri Jul 22, 2011 6:23 am
so first off, I AM using the .htaccess code to make a vanity URL.
basically, I followed the template system series, and it all works. however, I'm including ENITRE files with this page. there are a few problems here. but first the code:
index.php
first off, before this would work. now, through edits and redoes, it will only display the login page.
second, when it was working, if the user typed "isuvyo", then the title will be "RSS - Isuvyo". if the user types something random, then I want it to display the login page and have the title be the login page.
can someone please help me with this?
basically, I followed the template system series, and it all works. however, I'm including ENITRE files with this page. there are a few problems here. but first the code:
index.php
<?php if (empty($_GET['page']) || $_GET['page'] == "index"){ header("Location: login"); die(); } $pages = scandir("core/inc_files"); unset($pages[0], $pages[1]); foreach($pages as $page){ $page = substr($page, 0, strpos($page, '.')); } if (in_array($_GET['page'], $pages) === false){ $inc_file = "core//inc_files/login.php"; } else{ $inc_file = "core/inc_files/{$_GET['page']}.php"; } include ($inc_file); ?>Part of template/header.inc.php
<head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>RSS - <?php echo ucwords($_GET['page']); ?></title>and all the included files basically redirect to the read page if there's a set session, and include the header file.
first off, before this would work. now, through edits and redoes, it will only display the login page.
second, when it was working, if the user typed "isuvyo", then the title will be "RSS - Isuvyo". if the user types something random, then I want it to display the login page and have the title be the login page.
can someone please help me with this?