Need Help With Iframe PHP

Discussion in 'PHP' started by christopher.mah, Jun 14, 2009.

  1. #1
    Hello how would i make an iframe like this

    It must have some way of getting the url on the top so index.php?=http://domain.com

    I need it so that the http://domain.com can be any url and that the page will go to it.

    Somebody please help. and thank you!
     
    christopher.mah, Jun 14, 2009 IP
  2. Gray Fox

    Gray Fox Well-Known Member

    Messages:
    196
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    130
    #2
    Are you talking about something like

    URL:
    http://yoursite.com/index.php?url=http://google.com

    Simplified PHP:
    $content = "<frame src=\"{$_GET['url']}\"></frame>";
     
    Gray Fox, Jun 14, 2009 IP
  3. christopher.mah

    christopher.mah Peon

    Messages:
    351
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    aahh i dont know what to do someone help me please
     
    christopher.mah, Jun 14, 2009 IP
  4. FDIM

    FDIM Member

    Messages:
    55
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #4
    <?php
    $url=isset($_GET["url"])?$_GET["url"]:false;
    if($url){
    ?>
    <div>your header</div>
    <iframe src="<?=$url?>"></iframe>
    
    <?php
    }else{
    ?>
    show something if url is not provided
    <?php
    }
    ?>
    Code (markup):
    I think you know html/css :p
     
    FDIM, Jun 14, 2009 IP