Loading an Iframe for a specific domain

Status
Not open for further replies.

akwin4565

Junior Member
Joined
Dec 1, 2013
Messages
134
Reaction score
7
Consider i have two sites domain1 and domain2

I want to Iframe domain2 in domain1 for only particular websites like GOOGLE

HELP ME PLEASE...

THANKS IN ADVANCE.
 
I dont need full page
i need a code or something else that loads the iframe like below only to sites like for example google .

<iframe src="" scrolling="auto" style="display:none;"></iframe>
 
Should not be too tough. Use server side code for that. E.g. if you use php, sudo code might be something like:

Code:
// get the $_SERVER['HTTP_USER_AGENT'];
// match with some predfined bot strings like "googlebot" and so on ( make an array of those )
// if the string matches echo iframe else echo normal code
 
Can you help me with a example

i found words like googlebot but i duno where to use

and i m using php can you give me a example
 
^^ Could you be more specific on what you are trying to achieve? Do you want to show an iframe to visitors from google search, or do you want to show an iframe to the googlebot ( makes no sense to me lol) ?
 
I might be able to help but I'm not exactly sure what your trying to do??
So you want to have an iframe only if someone is coming from a certain site or what?
 
Yes only google search users must see the iframe
 
If you are trying to show iframe to visitors coming from certain sites like google, then check this stackoverflow question.
Code:
http://stackoverflow.com/questions/700672/how-do-you-detect-if-your-website-visitor-came-from-a-google-search-result
Edit: Get the http_referer . separate the domain after you get the referrer. In the domain, search for the term "google". If it matches, show the iframe.
 
Last edited:
if(stristr($_server['http_user_agent'], 'googlebot') === false) {
echo '<iframe src="" scrolling="auto" style="display:none;"></iframe>

i found the above code on a site but when i try this iframe loads when it is not from google search
 
that's completely different than what you need. This will show the iframe to a goole bot. You need to trace HTTP_REFERER , not the user agent.
i found the above code on a site but when i try this iframe loads when it is not from google search
 
Yes it should show to google but not to any other sites
 
Only google search users must see the iframe and others should not get the iframe.
 
Code:
$ref = @$_SERVER['HTTP_REFERER'];
$url_structure = parse_url($ref);
if(isset($url_structure['host'])){
if(stripos($url_structure['host'] , 'google') !== false){
    echo "<iframe src='http://blabla.com'>";
}else {
    echo "You are a normal visitor";
}
}else {
    echo "You are a normal visitor";
}

#spoonfeedme
 
In this all i have to do is to change the url??????

Thanks for the spoonfeed
 
Yes place proper iframe code there. In the else part will be your usual code(keep in mind that there are two else parts. To avoid this, in the if part disply iframe and exit() . Remove the else parts and place your usual code after that block of php).
In this all i have to do is to change the url??????

Thanks for the spoonfeed
 
Still i cant get it i m noob

just give me the code in which i have to place my site
 
Still i cant get it i m noob

just give me the code in which i have to place my site

Dear GOD

..............

HPM00381.jpg
 
I am new so that i ask if you could help me it wud be gr8
 
Status
Not open for further replies.
Back
Top