passing variables to outgoing links through PHP redirect
Posted: Sat Apr 28, 2007 12:42 am
Hi,
We don't know how to pass variables through PHP redirect script to outgoing links. All pages within the site are HTML. Links are maintained in one PHP file called links.php
The outgoing link within HTML would look like this:
The code of links.php looks like this:
Problem is:
How do we pass variables from incoming traffic that while you browse our site look like:
What we would want to happen is to get variables inserted into our links.php so it looks like this:
Please note that a string after "?" can be one word only, simply anything.
We just tried to present what we want to achieve. In real life, we don’t care how it happens, as long as we can continue to maintain our outgoing links in one PHP file.
Many thanks.
We don't know how to pass variables through PHP redirect script to outgoing links. All pages within the site are HTML. Links are maintained in one PHP file called links.php
The outgoing link within HTML would look like this:
Code: Select all
http://www.oursite.com/links.php?m=link23Code: Select all
<?
if ($_GET['m'] == "link23") {$link = "http://www.goout1.com";}
if ($_GET['m'] == "link24") {$link = "http://www.goout2.com";}
header("Location: $link");
?>How do we pass variables from incoming traffic that while you browse our site look like:
Code: Select all
http://www.oursite.com/somepage.html?variable1=XY&variable2=XZCode: Select all
<?
if ($_GET['m'] == "link23") {$link = "http://www.goout1.com?variable1=XY&variable2=XZ ";}
if ($_GET['m'] == "link24") {$link = "http://www.goout2.com?variable1=XY&variable2=XZ ";}
header("Location: $link");
?>We just tried to present what we want to achieve. In real life, we don’t care how it happens, as long as we can continue to maintain our outgoing links in one PHP file.
Many thanks.