php relocation on $_Get

Reply

Join Date: Sep 2007
Posts: 23
Reputation: becraig is an unknown quantity at this point 
Solved Threads: 0
becraig becraig is offline Offline
Newbie Poster

php relocation on $_Get

 
0
  #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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,275
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: php relocation on $_Get

 
0
  #2
Oct 6th, 2007
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 23
Reputation: becraig is an unknown quantity at this point 
Solved Threads: 0
becraig becraig is offline Offline
Newbie Poster

Re: php relocation on $_Get

 
0
  #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 Quick reply to this message  
Join Date: Sep 2007
Posts: 23
Reputation: becraig is an unknown quantity at this point 
Solved Threads: 0
becraig becraig is offline Offline
Newbie Poster

Re: php relocation on $_Get

 
0
  #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 Quick reply to this message  
Join Date: Oct 2007
Posts: 12
Reputation: jtmcgee is an unknown quantity at this point 
Solved Threads: 0
jtmcgee jtmcgee is offline Offline
Newbie Poster

Re: php relocation on $_Get

 
0
  #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 Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 3667 | Replies: 4
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC