Greetings, I was going to post this in the 'Blocks' section, however there is no 'new topic' button when I go there. /shrugs
Anyway. I am trying to setup an affiliate site using smf portal as the store front, with the forum on the back side. I installed a PHP block however the link that is supposed to go to my affiliate feed is being rewrote to point backwards to the forum. It actually breaks the link so bad it points to a page that is not even on the server LOL
Anyway, if somebody'd take a look for me, that'd be awesome.
Site URL elitedeeds.tk (http://elitedeeds.tk)
user demo
pass demo
Here is a link with the same code in a php file so you can see what is is supposed to do.
http://elitedeeds.tk/storedemo.php (http://elitedeeds.tk/storedemo.php)
code in the custom php block
<?php$SID="f4ed6f71-0b8b-4268-93c9-9cbca86f2a80";$IPAddress = urlencode($_SERVER['REMOTE_ADDR']);$UserAgent = urlencode($_SERVER['HTTP_USER_AGENT']);$Host=urlencode($_SERVER['HTTP_HOST']);$PageURL=urlencode($_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING']);$URL="http://si.goldencan.com/GetData.aspx?ver=2.0&SID=".$SID;$URL=$URL.'&Host='.$Host;$URL = $URL.'&PageURL='.$PageURL;$URL = $URL.'&IPAddress='.$IPAddress;$URL = $URL.'&UserAgent='.$UserAgent;include($URL);?>
Maybe I'm not entirely understanding but what links are we talking about? The ones showing in the block?
Yeah. The link in the block on the forum to 'amazon' goes to a 404. The link to amazon in the 'stordemo' ling goes to the proper page. They are the same exact code that is in the code block posted. However, when I put that code into a PHP block it's getting redirected for some reason. Where if the code is stand alone as in the 'demo' link, it works properly.
I need to know how to stop the redirect the PHP block is doing. I hope that clears it up a tad.
Thanks a ton
ED
Try this out and tell me how it goes:
<?php$bSID = 'f4ed6f71-0b8b-4268-93c9-9cbca86f2a80';$bIPAddress = urlencode($_SERVER['REMOTE_ADDR']);$bUserAgent = urlencode($_SERVER['HTTP_USER_AGENT']);$bHost = urlencode($_SERVER['HTTP_HOST']);$bPageURL = urlencode($_SERVER['SCRIPT_NAME'].'?' . $_SERVER['QUERY_STRING']);$bURL= 'http://si.goldencan.com/GetData.aspx?ver=2.0&SID=' . $bSID;$bURL= $bURL . '&Host='. $bHost;$bURL = $bURL . '&PageURL='. $bPageURL;$bURL = $bURL . '&IPAddress='. $bIPAddress;$bURL = $bURL . '&UserAgent='. $bUserAgent;include($bURL);?>
This is assuming two things: the globals being declared here are being overwritten at some point because they are common and probably are already defined. So I made them uncommon by making their names unique.
If this doesn't solve it, the problem is with how the host is being generated, since the server will be telling the script it's being loaded through index.php on the forums instead of whatever the amazon script would be.