Google redirect

Status
Not open for further replies.

akwin4565

Junior Member
Joined
Dec 1, 2013
Messages
134
Reaction score
7
---- THREAD CLOSED 06/17/2014 ----
I have site 1 and site 2 .
I have iframed site 1 with a file.
and site 2 contains the site 1 iframe.
I need a code that can only show the iframe to the users from google search.
 
Code:
if (strstr($_SERVER['HTTP_REFERER'], 'google') !== false ) {
    // Google brought me to this page.
}
 
Not sure what your html structure is but you could put the iframe like this:

Code:
if (strstr($_SERVER['HTTP_REFERER'], 'google') !== false ) {
    ?>
MY IFRAME CODE
<?php
}

where to place the iframe?
 
Code:
<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    ...
    <?php if (strstr($_SERVER['HTTP_REFERER'], 'google') !== false ) { ?>
    <iframe src=""></iframe>
    <?php } ?>
    ...
  </body>
</html>

:-)
 
Not sure what your html structure is but you could put the iframe like this:

Code:
if (strstr($_SERVER['HTTP_REFERER'], 'google') !== false ) {
    ?>
MY IFRAME CODE
<?php
}

I am using php could you give for php
 
Hi,

Can this code be used in blogger, I don't have adsense associated with my blog, so I can try this code. Also, in blogger where to place this code?
 
Status
Not open for further replies.
Back
Top