Main Menu
collapse

Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

User Info

Welcome Guest.
Please log in.

Who's Online

  • Dot Guests: 1119
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]


Blocks speak! Do you have an interest in getting more blocks - or even making your own? The Blocks Board is for you!

Stop PHP Block from redirecting links

Started by EliteDeeds, November 04, 2013, 05:19:59 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

EliteDeeds

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
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
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);?>


ccbtimewiz

Maybe I'm not entirely understanding but what links are we talking about? The ones showing in the block?

EliteDeeds

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

ccbtimewiz

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.