PDA

View Full Version : Help: Using a GET param in a header link URL...


GEngle
01-29-2008, 10:48 PM
Hello,

I'm new to vB but I've scoured many topics/documentation and I can't get this to work.

The header for my forum comes from a remote site and is inserted as an <iframe>. The src of the iFrame is passed in from the remote site such as "http://mysite.com". This all works great for the homepage; however, once you click on any link within the forum the GET param is gone (since it wasn't submitted in the link) and the header goes with it.

Naturally I need to store the domainURL ("http://mysite.com") as a variable that stays around after the initial GET is captured. To this end I created a global variable and initialized it within a Plugin (global_start hook).

Again this works initially (so I know the value is getting set) but it doesn't keep its value past the first page!

Here is my template header code:

<iframe
src="$GLOBALS[domainURL]/jsp/Header.jsp">
</iframe>

Here is my plug-in code:
if ($GLOBALS['domainURL'] == '')
{
$GLOBALS['domainURL'] = $_GET[domain];
}

I have even tried storing the GET param in $vbulletin->input->clean_gpc('g', 'domain', TYPE_STR). When I use this I only get Array['domain'] passed back. Perhaps I'm missing something there.

Any help would be appreciated!

Thanks!

Dismounted
01-30-2008, 05:09 AM
Get parameters are not passed between pages unless you actually put the parameter in the link.

GEngle
01-30-2008, 02:22 PM
Yes, I realize that. The GET parameter is passed in from the initial call; the problem I am having is keeping that parameter value after further clicks within the forum. Obviously I need to store the value within a variable of some sort and reference that variable. That is the problem I am having; trying to populate a variable that keeps the value, not the GET parameter itself. Make sense?

Dismounted
01-31-2008, 04:05 AM
PHP clears variables when the page finishes executing. The only way would be to either pass the parameter through every link, or store it in a cookie (will not work for those who have disabled cookies).

GEngle
01-31-2008, 03:13 PM
That would explain it... thanks!