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) != '097641342sjherjy')
{header.location 'URL'

}

?>


Can someone help me PLEEEEAAAASSEEEEE.

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.

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

thanks

<?

switch ( $_GET )

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.