Jump to content

Chenging Page Content (Logo) Based on Referring URL Query String...


garethdaine

Recommended Posts

Hi Folks,

 

This is my first post here and I was wondering if anyone could help me out at all please.

 

I would basically like to change the logo on the home page based on whether a query string from a referring URL has a specific value. It's an affiliate URL for an online store, so essentially I need to get the referrer, check if the query string adnetwork = as and then replace the logo if it does, if not leave it as it is. Does that make sense? Any help would very much appreciated.

 

I was thinking along the lines of:

 

<?php

 

if ($_GET('adnetwork') == 'as') {

changeLogo();

}

else

{

leaveLogo();

}

 

?>

 

Am I along the right lines folks?

Hi,

 

Thanks for the reply. I'm pretty new to PHP so don't really understand your code.

 

I'm thinking that this may work:

 

<?php

 

$referrer = $SERVER['HTTP_REFERRER'];

 

if $referrer($_GET('adnetwork') == 'as') {

changeLogo();

}

else

{

leaveLogo();

}

 

?>

Would this work? The JS file uses jQuery to replace the img src. Not sure how to do this in PHP.

 

<?php

 

$referrer = $SERVER['HTTP_REFERRER'];

 

if $referrer($_GET('adnetwork') == 'as') {

print '<script language="javascript" src="<?php echo $this->getSkinUrl(js/logo-replace.js) ; ?>"></script>';

}

else

{

 

}

 

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.