Forum Moderators: coopster
I have a page which when the visitor clicks on a link it takes them to redirect.php
Up until now I have parsed a simple URL with trailing variables i.e
<a href="redirect.php?variable1=a">
Then picked these variables up using $_GET in the redirect.php page.
Now as these details are include an affiliate link I thought I'd send the variables via a <Form> tag rather than <a href> to hide the details from my visitors:
<form action="redirect.php" etc>
<input type="hidden" name="variable1" value="a">
<input type="submit">
This gets the info into redirect.php as before but when redirect.php does it's stuff it tries to redirect but instead of going to http://www.example.com (which is what variable1 equates to) it tries to open this:
/currentdirectory/http://www.example.com
and so fails
My redirect page code is simply:
<?php
// get the search string passed to the page, and the page number if there is one
$url = '';
$url = $_GET['variable1'];
header('Location: '.$url,true);
?>
This worked perfectly when using the a href method.
Someone please help!
Cheers
Brett
[edited by: coopster at 4:28 pm (utc) on Nov. 7, 2006]
[edit reason] examplified url [/edit]