Forum Moderators: coopster
I have an online store and I want to redirect certain items when they are sent to checkout
the link looks like this
order.php?ipa=11
I want to have ipa=11 redirect to http://www.example.com
ipa=12 redirect to http://www.example.com
all other item number function normally
I found this code:
<?php
$var = $_SERVER['query_STRING'];
{
header("Location: http://www.example.com");
exit;
}
?>
I need it to say "if query string is equal to 11 then header location is www.example.com
if query string is 12 then redirect to www.example.com/nextpage.html
and so on
but if the query string is 13 then the page will function as it does now
I hope this is enough information to figure out my problem, thanks in advance for any help on this topic!
[edited by: eelixduppy at 5:13 am (utc) on Mar. 10, 2009]
[edit reason] switched to example.com [/edit]
<?php
$ipa = addslashes($_REQUEST['ipa']);
if ($ipa == 11) {
Header( "HTTP/1.1 301 Moved Permanently" );
header("Location: http://www.example.com");
exit;
} else if ($ipa == 12) {
Header( "HTTP/1.1 301 Moved Permanently" );
header("Location: http://www.example.com/nextpage.html ");
exit;
}
?>
Anyway, if you need more info please let me know.