Please help!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
BachgenCymreig
Forum Newbie
Posts: 12
Joined: Fri Sep 22, 2006 3:57 pm

Please help!!

Post by BachgenCymreig »

Hi, I was wondering if someone could be so kind to help with a problem I am having.

I am using the following code:

Code: Select all

<?php
  if (!isset($id)) {
   header("Location: index.php?id=home");
}
?>
Ok the problem I am getting is I have one server running PHP 4.4.1 and this code works fine so if you try to load index.php it redirects to index.php?id=home because id hasn't been defined in the URL. Now the problem is when I try to use this on the server (which I really need it to work on) which is running PHP 4.4.2 it gets stuck in some sort of loop and won't load.

Is this a problem with the PHP version, is there an alternative way to do this? or what????

Help!!!

Any suggestions appreciated.

Thanks!
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Code: Select all

if(!isset($_GET['id']))
Your current code relies on register_globals being on. It is probably off (as it should be) on the current server.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
BachgenCymreig
Forum Newbie
Posts: 12
Joined: Fri Sep 22, 2006 3:57 pm

Post by BachgenCymreig »

Let me try that - ty :D
User avatar
gkwhitworth
Forum Commoner
Posts: 85
Joined: Tue Sep 05, 2006 8:28 pm
Location: Wasilla, Alaska

Post by gkwhitworth »

Just thought I'd let you know that you will get more help if your subject is more specific than "Please help." You could of used "Problems redirecting on PHP 4.2" or something. I thought I'd tell you before one of the mods laid a smack down. :lol:

--
Greg
Post Reply