1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP redirect with frames

Discussion in 'PHP' started by SharingEngines, Dec 5, 2010.

  1. #1
    Hi,

    I have a big problem with home!

    I have this code out.php when someone cliks on a link on my web page goes to http://www.xxxx.com/out.php?url=http://www.yyyyy.com here I have 2 frames
    Header = frame.php and Main = http://www.yyyyy.com and It works very well.

    The problem is when I click on "Home" in frame.php he don't goes to homepage "http://www.xxxx.com/"

    <?php
    
    //default url if none is set
    $nourl = "http://www.xxxx.com/";   
    
        $url=$_GET["url"];
        if(!$url)
        {
            $url=$nourl;
        }
    ?>
    <html>
    <head>
    <title>XXXX</title>
    </head>
    
    <frameset rows="132px,*" frameborder="NO" border="0" framespacing="0">
      <frame src="frame.php?url=<?php echo"$url" ?>" name="frame" scrolling="NO" noresize>
      <frame src="<?php echo "$url"; ?>" name="main">
    </frameset>
    <noframes>
    <body>
    
    </body>
    </noframes>
    </html> 
    Code (markup):
    And I have this code frame.php

    <html>
    <head>
    <title>XXXX</title>
    </head>
    <link rel="stylesheet" type="text/css" href="frame.css" />
    <body>
    <b><a href = "http://www.xxxx.com" style="text-decoration: none"><font color="#000000">Home</font></a> 	
    </body>
    </html>
    Code (markup):
    The code working well except when I click on "Home" on frame.php it don't goes to http://www.xxxx.com.

    Any chance to make "Home" goes to http://www.xxxx.com?

    Thank you very much for your help.
     
    SharingEngines, Dec 5, 2010 IP
  2. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #2
    
    <?php 
    
    $url = $_GET['url'];
    
    if (empty($url)) {
            $url = "http://www.google.com/";
        }
    
    ?>
    <html>
    <head>
    <title>XXXX</title>
    </head>
    
    <frameset rows="132px,*" frameborder="NO" border="0" framespacing="0">
      <frame src="frame.php?url=<?=$url?>" name="frame" scrolling="NO" noresize>
      <frame src="<?=$url?>" name="main">
    </frameset>
    <noframes>
    <body>
    
    </body>
    </noframes>
    </html>
    
    PHP:
     
    MyVodaFone, Dec 5, 2010 IP
  3. SharingEngines

    SharingEngines Member

    Messages:
    83
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #3
    SharingEngines, Dec 5, 2010 IP
  4. SharingEngines

    SharingEngines Member

    Messages:
    83
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #4
    Hi,

    I don't know if I could put my site here but if there is any problem please remove.

    I have this site http://www.notpt.com/

    When I click on "Ver Notícia Completa" I go to a url like this "http://www.notpt.com/out.php?url=http://news.google.com/news/url?sa=t&fd=R&usg=AFQjCNFuQxXt-ejc4bOf1wE_cvnLiSnS7g&url=http://www.verdadeiroolhar.pt/materias.php?secao%3Dultimahora%26id%3D15652"

    On top frame I have a "Home" and when I click, instead to go http://www.notpt.com goes to http://www.notpt.com/out.php?url=ht...har.pt/materias.php?secao=ultimahora&id=15652

    Do you like to try?
     
    SharingEngines, Dec 5, 2010 IP
  5. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #5
    When I click on HOME it works fine and so do all other links on FF and IE, try to clear your browser history.

    "Ver Notícia Completa" this link does not work so you need to edit that
     
    MyVodaFone, Dec 5, 2010 IP
  6. SharingEngines

    SharingEngines Member

    Messages:
    83
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #6
    I try on a new formated computer and dosen't work.

    Try put this link on your url "http://www.notpt.com/out.php?url=http://news.google.com/news/url?sa=t&fd=R&usg=AFQjCNFuQxXt-ejc4bOf1wE_cvnLiSnS7g&url=http://www.verdadeiroolhar.pt/materias.php?secao%3Dultimahora%26id%3D15652"

    Now on top frame try click on "Home", you do not goes to http://www.notpt.com/
     
    SharingEngines, Dec 5, 2010 IP
  7. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #7
    Try adding to your home link
    target="_top"
    Code (markup):
    Like this
    <b>&nbsp;<a href = "http://www.notpt.com" target="_top" style="text-decoration: none"><font color="#FFFFFF">Home</font></a>
    Code (markup):
     
    Last edited: Dec 5, 2010
    MyVodaFone, Dec 5, 2010 IP
  8. SharingEngines

    SharingEngines Member

    Messages:
    83
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #8
    He he he,

    You are the best!

    Thank you very much for your help!
     
    SharingEngines, Dec 5, 2010 IP
    MyVodaFone likes this.