My host recently moved my sites to a new server and since then i've noticed a problem with one site and the links.
The site is just a portal site, havn't changed it in ages. http://irealms.co.uk
The links are in the format : index.php?page=pagename
and are included into the index in a content file like :
if ($page=='') include 'home.php';
if ($page=='home') include 'home.php';
if ($page=='about') include 'about.php';
if ($page=='scripts') include 'scripts.php';
All worked fine until i spotted the error now. No idea whats causing it.
Any ideas? Could it be something to do with the new server setup?
Weird error
Moderator: General Moderators
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
1st this is a php question so don't worry, you can ask this in the php forum
. I would bet $100 that your old server had register_globals on since you are using ?page=home and whatnot. do this
Code: Select all
$page = $_GET['page'];//notice the superglobal $_GET. you should use this when getting a variable from a URL
switch ($page)
{
case 'scripts':
include 'scripts.php';
break;
case 'about':
include 'about.php';
break;
default:
include 'home.php';
}