Hi everyone, I am fairly new to php and I am trying to get a redirect page to work and almost have it except I can not seem to include a variabled passed in via the incoming link to the new redirected link in the code. Here is what I have in a file called jump.php. I want to be able to pass in an url like http://mydomain.com/jump.php?id=1&ref=2 and have it redirect to http://linkout.com&ref=2
How do I properly insert the code after ref= to pass in the variable that came in via the incoming url?
PHP Code:
<?php $id =$_GET['id']; $ref =$_GET['ref']; if ($id == "") {$link = 'http://linkout.com&ref=';} //Default Blank if ($id == "1") {$link = 'http://linkout.com&ref=';} // page 1 header('HTTP/1.1 301 Moved Permanently'); // Clean 301 header header("Location: $link"); // Jump to the link exit(); ?>
|