PHP Redirect

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
User avatar
dclamp
Forum Commoner
Posts: 35
Joined: Sun Sep 17, 2006 10:05 am

PHP Redirect

Post by dclamp »

I have a PHP page on my domain: http://dclamp.homtek.net/invite.php.

i have it redirect to this page: http://www.rapidfriends.com/join_inv.php?member_id=94 only.

I want it so that some one can put there ID in my domain and have it put it at the end. like this:

They Visit: http://dclamp.homtek.net/invite.php?ID=91

and it redirects to: http://www.rapidfriends.com/join_inv.php?member_id=91

how do i do this?
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(!empty($_GET['id']) && is_numeric($_GET['id']))
{
   header('Location: http://www.domain.com/page.php?id='.$_GET['id']);
} else
{
   header('Location: http://www.domain.com/page.php');
}
:wink:
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.
Post Reply