Y T Nuke  
Results 1 to 19 of 19
Im trying to keep this in my header and just redirect the target iframe below. ...
  1. #1
    sapo's Avatar
    sapo is offline Regular Member
    Join Date
    Feb 2008
    Posts
    396
    Reputation
    43
    Thanks
    144
    Thanked 166 Times in 98 Posts

    Default php Url redirection to iframe

    Im trying to keep this in my header and just redirect the target iframe below.

    like this php redirection will be in the horizantly navigation that it the main page and the body is a iframe.

    Code:
    <?php
    $user_agent = $_SERVER['HTTP_USER_AGENT'];
    
    if(preg_match('/microsoft|window/i', $user_agent)) {
    	header('Location: http://www.yahoo.com');
    } elseif(preg_match('/mac|os x/i', $user_agent)) {
    	header('Location: http://www.google.com');
    } else {
    	header('Location: http://www.bing.com');
    }
    
    ?>
    
    <iframe name="donkey" src="http://donkey.com" </frame>
    how do i change the redirection to traget the iframe?
    Juan ManuelMarquez Do you have targetted Traffic? AnyNiche I can Monetize it. Avg EPC .28

  2. #2
    Gz us is offline Newbies
    Join Date
    Dec 2011
    Posts
    9
    Reputation
    10
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default Re: php Url redirection to iframe

    i cant post links since im new here but if you PM me i've got a url to explain it and provide working code.

  3. The Following User Says Thank You to Gz us For This Useful Post:

    sapo (12-24-2011)

  4. #3
    Autumn's Avatar
    Autumn is offline Elite Member
    Join Date
    Nov 2010
    Location
    Spamville
    Posts
    2,030
    Reputation
    1778
    Thanks
    518
    Thanked 2,361 Times in 1,092 Posts

    Default Re: php Url redirection to iframe

    haha... that code looks familiar.

    I'm not quite sure what you want to do from your description - you have an iframe on your page, and you want to show different content in the iframe depending on the OS?
    "An ounce of action is worth a ton of theory." - Ralph Waldo Emerson

  5. The Following User Says Thank You to Autumn For This Useful Post:

    sapo (12-24-2011)

  6. #4
    Gz us is offline Newbies
    Join Date
    Dec 2011
    Posts
    9
    Reputation
    10
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default Re: php Url redirection to iframe

    its old school html. like having a top nav bar that is loaded from say index.php and the lower portion of the site is an iframe. using the nav bar u want to change the pages of the iframe, not the entire page.

  7. The Following User Says Thank You to Gz us For This Useful Post:

    sapo (12-24-2011)

  8. #5
    Autumn's Avatar
    Autumn is offline Elite Member
    Join Date
    Nov 2010
    Location
    Spamville
    Posts
    2,030
    Reputation
    1778
    Thanks
    518
    Thanked 2,361 Times in 1,092 Posts

    Default Re: php Url redirection to iframe

    Quote Originally Posted by Gz us View Post
    its old school html. like having a top nav bar that is loaded from say index.php and the lower portion of the site is an iframe. using the nav bar u want to change the pages of the iframe, not the entire page.
    That style of navigation would generally be a regular frameset, not an iframe.

    I'm still not quite clear what the OP is trying to achieve, because the current code would be redirecting all traffic to a search engine before the iframe is displayed.
    "An ounce of action is worth a ton of theory." - Ralph Waldo Emerson

  9. The Following User Says Thank You to Autumn For This Useful Post:

    sapo (12-24-2011)

  10. #6
    Gz us is offline Newbies
    Join Date
    Dec 2011
    Posts
    9
    Reputation
    10
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default Re: php Url redirection to iframe

    [shrugs] i was jus tryin to point him to a iframehtml page that explains this option, along with some alternatives lo

    hopefully he just changed the urls to diff ones to keep his pages to himself, cause i have no clue why one would want to route to diff search engines.

  11. The Following User Says Thank You to Gz us For This Useful Post:

    sapo (12-24-2011)

  12. #7
    sapo's Avatar
    sapo is offline Regular Member
    Join Date
    Feb 2008
    Posts
    396
    Reputation
    43
    Thanks
    144
    Thanked 166 Times in 98 Posts

    Default Re: php Url redirection to iframe

    LOL yeah that code is familiar, jacked it from the other thread sort of.

    but yeah this is what I want.

    =====================
    top nav bar
    <php code that redirects but instead of redirecting the whole page to somehwere just redirect the iframe below

    =============================
    ============================
    < iframe name ="target iframe /iframe >

    ================================================== ==

    hope that explains it, It rough
    Juan ManuelMarquez Do you have targetted Traffic? AnyNiche I can Monetize it. Avg EPC .28

  13. #8
    hellohellosharp's Avatar
    hellohellosharp is offline Power Member
    Join Date
    Dec 2010
    Location
    ON MY WEBSITE:---> http://moneyblogcenter.com/ <-----
    Posts
    503
    Reputation
    80
    Thanks
    35
    Thanked 300 Times in 99 Posts

    Default Re: php Url redirection to iframe

    Quote Originally Posted by sapo View Post
    LOL yeah that code is familiar, jacked it from the other thread sort of.

    but yeah this is what I want.

    =====================
    top nav bar
    <php code that redirects but instead of redirecting the whole page to somehwere just redirect the iframe below

    =============================
    ============================
    < iframe name ="target iframe /iframe >

    ================================================== ==

    hope that explains it, It rough
    Oh, if i get what you are saying, than thats cake

    Code:
    <?php
    $user_agent = $_SERVER['HTTP_USER_AGENT'];
    
    if(preg_match('/microsoft|window/i', $user_agent)) {
    	$site= "http://www.yahoo.com";
    } elseif(preg_match('/mac|os x/i', $user_agent)) {
    	$site="http://www.google.com";
    } else {
    	$site= "http://www.bing.com";
    }
    
    ?>
    
    <iframe name="donkey" src="<?php echo $site; ?>" </frame>
    Hope it helps
    Increase Your CPA Revenue With FREE Geo-Targeting bit.ly/xEmiId EASY TO USE

  14. The Following User Says Thank You to hellohellosharp For This Useful Post:

    sapo (12-24-2011)

  15. #9
    hellohellosharp's Avatar
    hellohellosharp is offline Power Member
    Join Date
    Dec 2010
    Location
    ON MY WEBSITE:---> http://moneyblogcenter.com/ <-----
    Posts
    503
    Reputation
    80
    Thanks
    35
    Thanked 300 Times in 99 Posts

    Default Re: php Url redirection to iframe

    Sorry, didn't see the "name" thing where the iframe's name has to change. Im not sure why that would matter, but here is the code for that:

    Code:
    <?php
    $user_agent = $_SERVER['HTTP_USER_AGENT'];
    
    if(preg_match('/microsoft|window/i', $user_agent)) {
    	$site= "http://www.yahoo.com";
    $name="yahoo";
    } elseif(preg_match('/mac|os x/i', $user_agent)) {
    	$site="http://www.google.com";
    $name="google";
    } else {
    	$site= "http://www.bing.com";
    $name="bing";
    }
    
    ?>
    
    <iframe name="<?php echo $name; ?>" src="<?php echo $site; ?>" </frame>
    Increase Your CPA Revenue With FREE Geo-Targeting bit.ly/xEmiId EASY TO USE

  16. The Following User Says Thank You to hellohellosharp For This Useful Post:

    sapo (12-24-2011)

  17. #10
    Autumn's Avatar
    Autumn is offline Elite Member
    Join Date
    Nov 2010
    Location
    Spamville
    Posts
    2,030
    Reputation
    1778
    Thanks
    518
    Thanked 2,361 Times in 1,092 Posts

    Default Re: php Url redirection to iframe

    So you want to display different content in the iframe below depending on what link they click in the top navbar?

    Here's your main page that contains the iframe:
    Code:
    <html>
    <head>
    <title>Main page</title>
    <script>
    function loadIframe(iframeName, url) {
        if ( window.frames[iframeName] ) {
            window.frames[iframeName].location = url;   
            return false;
        }
        return true;
    }
    </script>
    </head>
    <body>
    <a href="iframepage.php?id=1" onclick="return loadIframe('myiframe', this.href)">Page 1</a> | 
    <a href="iframepage.php?id=2" onclick="return loadIframe('myiframe', this.href)">Page 2</a> | 
    <a href="iframepage.php?id=default" onclick="return loadIframe('myiframe', this.href)">Default</a>
    <br>
    <br>
    <iframe src="iframepage.php?id=default" name="myiframe" id="myiframe" width="800" height="800"></iframe>
    </body>
    </html>
    Here's your iframe page that loads a different url, depending on the top nav bar link that was clicked:

    Code:
    <?php
    
    if($id = $_GET['id']) {
    	// great
    } else {
    	$id = 'default';
    }
    
    switch($id) {
    	case '1':
    		//echo "It's 1";
    		header("Location: http://www.wormgush.com/", true, 301);
    		break;
    	case '2':
    		//echo "It's 2";
    		header("Location: http://www.eelsoup.net/", true, 301);
    		break;
    	default:
    		//echo "Default";
    		header("Location: http://www.nutabuse.com/", true, 301);
    		break;
    }
    
    ?>
    You can see that the main page contains a javascript function that loads a new version in the iframe.

    The iframe page takes a $_GET argument and allows you to load a different url depending on which $_GET variable you append to the iframe url.
    "An ounce of action is worth a ton of theory." - Ralph Waldo Emerson

  18. The Following User Says Thank You to Autumn For This Useful Post:

    sapo (12-24-2011)

  19. #11
    hellohellosharp's Avatar
    hellohellosharp is offline Power Member
    Join Date
    Dec 2010
    Location
    ON MY WEBSITE:---> http://moneyblogcenter.com/ <-----
    Posts
    503
    Reputation
    80
    Thanks
    35
    Thanked 300 Times in 99 Posts

    Default Re: php Url redirection to iframe

    Sorry, I must have misinterpreted. Autmun's anwsner is more correct than mine.

    But why are you using $_SERVER['HTTP_USER_AGENT'] ? That is used to get the browser of user, has nothing to do really with navigation.

    My script is for a different iframe based on a different browser.

    Also, the easiest way to make buttons that navigate iframes is just use javascript to change the src of the iframe.
    Increase Your CPA Revenue With FREE Geo-Targeting bit.ly/xEmiId EASY TO USE

  20. The Following User Says Thank You to hellohellosharp For This Useful Post:

    sapo (12-24-2011)

  21. #12
    sapo's Avatar
    sapo is offline Regular Member
    Join Date
    Feb 2008
    Posts
    396
    Reputation
    43
    Thanks
    144
    Thanked 166 Times in 98 Posts

    Default Re: php Url redirection to iframe

    thanks everyone for their response I dont have time to test right now but will test within the hours and reply. thanks. love bhw
    Juan ManuelMarquez Do you have targetted Traffic? AnyNiche I can Monetize it. Avg EPC .28

  22. #13
    sapo's Avatar
    sapo is offline Regular Member
    Join Date
    Feb 2008
    Posts
    396
    Reputation
    43
    Thanks
    144
    Thanked 166 Times in 98 Posts

    Default Re: php Url redirection to iframe

    I tested all the example but none worked. some about the url is too long, seems like it was just adding to itself

    check this out.
    Code:
    http://bit.ly/uQWQPP
    maybe that will explain what I looking for.

    and the reason Im doing this is cause I am redirecting on referrer no operating system, so that why I need it to be on the top part and control the iframe. instead of the iframe just having the code cause then it will always be my own site being the referrer
    Juan ManuelMarquez Do you have targetted Traffic? AnyNiche I can Monetize it. Avg EPC .28

  23. #14
    hellohellosharp's Avatar
    hellohellosharp is offline Power Member
    Join Date
    Dec 2010
    Location
    ON MY WEBSITE:---> http://moneyblogcenter.com/ <-----
    Posts
    503
    Reputation
    80
    Thanks
    35
    Thanked 300 Times in 99 Posts

    Default Re: php Url redirection to iframe

    Quote Originally Posted by sapo View Post
    I tested all the example but none worked. some about the url is too long, seems like it was just adding to itself

    check this out.
    Code:
    http://bit.ly/uQWQPP
    maybe that will explain what I looking for.

    and the reason Im doing this is cause I am redirecting on referrer no operating system, so that why I need it to be on the top part and control the iframe. instead of the iframe just having the code cause then it will always be my own site being the referrer
    You seem to change the thing you're looking for with each post.

    Here is a script that changes the iframe based on the referer:

    Code:
    <?php
    $referrer=$_SERVER['HTTP_REFERER'];
    
    if ($referrer=="http://facebook.com")
    $site="http://websiteA.com";
    elseif ($referrer=="http://twitter.com")
    $site="http://websiteB.com";
    else
    $site="http://websiteC.com";
    ?>
    
    <iframe src="<?php echo $site; ?>"></iframe>
    Increase Your CPA Revenue With FREE Geo-Targeting bit.ly/xEmiId EASY TO USE

  24. The Following User Says Thank You to hellohellosharp For This Useful Post:

    sapo (12-24-2011)

  25. #15
    sapo's Avatar
    sapo is offline Regular Member
    Join Date
    Feb 2008
    Posts
    396
    Reputation
    43
    Thanks
    144
    Thanked 166 Times in 98 Posts

    Default Re: php Url redirection to iframe

    Quote Originally Posted by hellohellosharp View Post
    You seem to change the thing you're looking for with each post.

    Here is a script that changes the iframe based on the referer:

    Code:
    <?php
    $referrer=$_SERVER['HTTP_REFERER'];
    
    if ($referrer=="http://facebook.com")
    $site="http://websiteA.com";
    elseif ($referrer=="http://twitter.com")
    $site="http://websiteB.com";
    else
    $site="http://websiteC.com";
    ?>
    
    <iframe src="<?php echo $site; ?>"></iframe>
    lol thanks that worked, I figured the os code and referrer code were the same, so I just copied and paste that code rather then logging into my cpanel at the time and grabbing the real code. and I type how I talk lol, But thanks man greatly appeaciated..l
    Juan ManuelMarquez Do you have targetted Traffic? AnyNiche I can Monetize it. Avg EPC .28

  26. #16
    Autumn's Avatar
    Autumn is offline Elite Member
    Join Date
    Nov 2010
    Location
    Spamville
    Posts
    2,030
    Reputation
    1778
    Thanks
    518
    Thanked 2,361 Times in 1,092 Posts

    Default Re: php Url redirection to iframe

    Quote Originally Posted by sapo View Post
    I tested all the example but none worked. some about the url is too long, seems like it was just adding to itself

    check this out.
    Code:
    http://bit.ly/uQWQPP
    maybe that will explain what I looking for.

    and the reason Im doing this is cause I am redirecting on referrer no operating system, so that why I need it to be on the top part and control the iframe. instead of the iframe just having the code cause then it will always be my own site being the referrer
    If you tried the code I posted then you must have made an error somewhere because I tested it and it worked fine.

    Also it pays to be specific both when reporting error messages and when describing what you want to do. You just wasted a bunch of people's time because you didn't describe what you really wanted to do until your 4th post in the thread.
    "An ounce of action is worth a ton of theory." - Ralph Waldo Emerson

  27. The Following User Says Thank You to Autumn For This Useful Post:

    sapo (12-24-2011)

  28. #17
    sapo's Avatar
    sapo is offline Regular Member
    Join Date
    Feb 2008
    Posts
    396
    Reputation
    43
    Thanks
    144
    Thanked 166 Times in 98 Posts

    Default Re: php Url redirection to iframe

    Quote Originally Posted by Autumn View Post
    If you tried the code I posted then you must have made an error somewhere because I tested it and it worked fine.

    Also it pays to be specific both when reporting error messages and when describing what you want to do. You just wasted a bunch of people's time because you didn't describe what you really wanted to do until your 4th post in the thread.
    Im sorry man didnt mean to offend anyone, and I seen hello answered it way before. I just didnt look hard enough. My bad. I was exteremly swamped right now with pms etc etc. not an excuse. sorry.
    Juan ManuelMarquez Do you have targetted Traffic? AnyNiche I can Monetize it. Avg EPC .28

  29. #18
    sapo's Avatar
    sapo is offline Regular Member
    Join Date
    Feb 2008
    Posts
    396
    Reputation
    43
    Thanks
    144
    Thanked 166 Times in 98 Posts

    Default Re: php Url redirection to iframe

    revisiting this, I cant get the iframe to be a full page iframe, it just a lil 400 by 400 square.

    Code:
    <?php
    $referrer=$_SERVER['HTTP_REFERER'];
    
    if ($referrer=="http://facebook.com")
    $site="http://yahoo.com";
    elseif ($referrer=="http://twitter.com")
    $site="http://google.com";
    else
    $site="http://bing.com";
    ?>
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="EN">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <style type="text/css">
    html {overflow: auto;}
    html, body, div, iframe {margin: 0px; padding: 0px; height: 100%; border: none;}
    iframe {display: block; width: 100%; border: none; overflow-y: auto; overflow-x: hidden;}
    </style>
    </head>
    <body>
    <iframe id="tree" name="tree" src="<?php echo $site; ?>" frameborder="0" marginheight="0" marginwidth="0" width="100%" height="100%" scrolling="auto"></iframe>
    </body>
    </html>
    thats what I am using, I need the iframe to be full page
    Juan ManuelMarquez Do you have targetted Traffic? AnyNiche I can Monetize it. Avg EPC .28

  30. #19
    cacoleman1983 is offline Newbies
    Join Date
    Aug 2009
    Location
    United States
    Posts
    17
    Reputation
    10
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: php Url redirection to iframe

    <html>
    <head><title>iframe 100%</title>
    <style type="text/css"> body,html{width:100%;height:100%;margin:0;overflow :hidden}</style>
    </head>
    <body>
    <iframe width="100%" height="100%" frameborder="0" src="cant/post/links/yet.html"></iframe>
    </body>
    </html>

    I got this code from another post. It should work on all browsers.

Natural Slow Link Building


SEO Blasts - High quality link building service

Similar Threads

  1. Url Redirection Based on Operating System?
    By jutt29 in forum Cloaking and Content Generators
    Replies: 3
    Last Post: 12-17-2011, 05:34 PM
  2. unwarping / decoding URL redirection?
    By SEOfarmer in forum Black Hat SEO
    Replies: 0
    Last Post: 11-09-2011, 04:08 PM
  3. redirection from one url to another same domain
    By aldragon in forum PHP & Perl
    Replies: 6
    Last Post: 02-01-2011, 05:13 AM
  4. Fake real referer url redirection
    By foxler in forum Cloaking and Content Generators
    Replies: 2
    Last Post: 08-07-2008, 07:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
  SEnukeX SEO Software
Proudly Powered by Hostwinds.com Web Hosting Click Here For Exclusive BHW Discounts!

Cheap Web Hosting


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76