944,150 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 5526
  • PHP RSS
Oct 6th, 2007
0

php relocation on $_Get

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
becraig is offline Offline
29 posts
since Sep 2007
Oct 6th, 2007
0

Re: php relocation on $_Get

Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Oct 6th, 2007
0

Re: php relocation on $_Get

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.
Reputation Points: 10
Solved Threads: 0
Light Poster
becraig is offline Offline
29 posts
since Sep 2007
Oct 6th, 2007
0

Re: php relocation on $_Get

ok I got it I defined the variable first from the $get then evaluated the if for the variable

thanks
Reputation Points: 10
Solved Threads: 0
Light Poster
becraig is offline Offline
29 posts
since Sep 2007
Oct 7th, 2007
0

Re: php relocation on $_Get

<?

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jtmcgee is offline Offline
13 posts
since Oct 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Never used PHP before and would need ALL YOUR HELP
Next Thread in PHP Forum Timeline: Not Another PhpBB Integration





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC