I am having a problem getting my variable from my url. My landing page - index.php shown below - has the following code, which is used to alternate between two sales pages:
<?php $id=8; include('/home/myaccount/mysite.com/html/sta/topper.php');?>
<?php if ($f[1]==1){include "http://www.mysite.com/page1.php";}?>
<?php if ($f[1]==2){include "http://www.mysite.com/page2.php";}?>
On page1.php and page2.php I have an include that contains code that takes variables from the url. A snippet is below:
$ipaddress=$_SERVER['REMOTE_ADDR'];
$var1 = $_GET['myvariable'];
Also, on page1.php and page2.php the links that the visitor will click look like this:
"http://www.mysite.com/redirect.php?sub=<?php echo $var1; ?>&offer=abc"
Now $var1 is getting logged in my tracking system, but it doesn't seem to be echoed to the link. page1.php and page2.php work fine if I just load up those pages individually, but they do not echo the $var1 when using index.php.
What could be the cause of this?
Thanks,
Jon