Gosh my problem is so simple compared to most of these here - I feel ashamed - nonetheless, it is my problem 🙂
I've been using the header statement in simple little php files instead of plain links on my affiliate sites. Like this:
<?php
header ("Location: http://www.nicesite/product_info.php?ref=xxxx&products_id=1xx");
?>
Works fine, but problem is I end up with loads of little files. So I figured - better idea to put them all in one file called links.php and use variables:
I tested it as follows with one link:
<?php
$variable1= header ("Location: http://www.nicesite/product_info.php?ref=xxxx&products_id=1xx");
?>
Worked great. So I spent hours building the whole file links.php only to find that it doesn't work because...
<?php
$variable1= header ("Location: http://www.nicesite1/product_info.php?ref=xxxx&products_id=1xx");
$variable2= header ("Location: http://www.nicesite2/product_info.php?ref=xxxx&products_id=1xx");
$variable3= header ("Location: http://www.nicesite3/product_info.php?ref=xxxx&products_id=1xx");
?>
When I link to links.php?variable1 it takes me to nicesite3 instead of nicesite1. In other words, it picks up the first variable and shoots off the last header statement.
Can someone please shine some wisdom on this for me? I'm sure it's a really crass error, but I'm such a newbie at this and I just can't find the info I need in the php book I've got. I'd really appreciate it.
(Sorry - should have posted in newbie section!)