User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,532 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,893 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1497 | Replies: 4
Reply
Join Date: Sep 2007
Posts: 6
Reputation: becraig is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
becraig becraig is offline Offline
Newbie Poster

php relocation on $_Get

  #1  
Oct 6th, 2007
I need some help here I am trying to figure out to set a php file to go to different URLS based on the request it receives.

eg this code might make no sense at all

I want to code for 6 different referrers.


<?php
if (($_GET['PID']) != '097641342sjherjy')
{header.location 'URL'

}

?>


Can someone help me PLEEEEAAAASSEEEEE.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Posts: 4,832
Reputation: iamthwee is a glorious beacon of light iamthwee is a glorious beacon of light iamthwee is a glorious beacon of light iamthwee is a glorious beacon of light iamthwee is a glorious beacon of light 
Rep Power: 17
Solved Threads: 324
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Industrious Poster

Re: php relocation on $_Get

  #2  
Oct 6th, 2007
... the hat of 'is this a cat in a hat?'
Reply With Quote  
Join Date: Sep 2007
Posts: 6
Reputation: becraig is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
becraig becraig is offline Offline
Newbie Poster

Re: php relocation on $_Get

  #3  
Oct 6th, 2007
I know how to find the variables that is not the question

What I NEED is this

a way to code


<?php

if(($_GET["PID"]) == "piddetails")
{

header("Location: http://www.pagename");

}
?>

and to be able to evaluate and redirect for six other values for PID
That is what I am trying to find out.
Reply With Quote  
Join Date: Sep 2007
Posts: 6
Reputation: becraig is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
becraig becraig is offline Offline
Newbie Poster

Re: php relocation on $_Get

  #4  
Oct 6th, 2007
ok I got it I defined the variable first from the $get then evaluated the if for the variable

thanks
Reply With Quote  
Join Date: Oct 2007
Posts: 4
Reputation: jtmcgee is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jtmcgee jtmcgee is offline Offline
Newbie Poster

Re: php relocation on $_Get

  #5  
Oct 7th, 2007
<?

switch ( $_GET['PID'] )

case '3495843509843503':
header("Location: http://www.pagename");
break;
case '640968450':
header("Location: http://www.pagename");
break;
default:
echo"We could not redirect you sorry";
break;

?>

That should be good, you'll have to add more cases and stuff though.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 4:34 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC