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?

Link to comment
Share on other sites

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

}

 

?>

Link to comment
Share on other sites

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

{

 

}

 

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.