Results 1 to 4 of 4

Thread: controling iframe address Help Please.

  1. #1
    Join Date
    Nov 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question controling iframe address Help Please.

    Hi, I have a little problem.
    I want to make a little web app that will do this:
    There will be a text field on top, beside it "Go", "Refresh", "Back" "Forward" buttons. After those there will be an iframe that will open www.google.com for example. Now I want to do this. I want to be able to type an address in that text field and when I hit "Go" button, it changes the address of the iframe. And other functions for other buttons to control the iframe. I searched lots of websites and I couldn't find anything useful.

    If anyone knows or knows an example of this on the internet, please help me.

    Tnx. Waiting for your reply.

  2. #2
    Join Date
    Jul 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You must use php, you cant do that with html only. Simple example that i made:
    PHP Code:
    <html> 

    <head> 

    <title>Iframe testing</title> 

    </head> 

    <body> 


    <form action="#" target="window"> 
    <input type=button value="Back" onClick="javascript:history.go(-1)"> 

    <input type=button value="Refresh" onClick="history.go()"> 

    <input type = "button" value = "Forward" onClick = "window.history.go(1)"> 

    </form> 

    <form action="#" method="get">  
      
    <input type="text" name="url" size="10">  
    <input type=submit value="Go">  

    </form> 


    <?php 

    $page 
    $_GET['url'];  

    ?> 

    <iframe  name="window" src="<?php echo $page;?>"></iframe> 

    </body> 

    </html>
    Hope this helped
    Last edited by Hyperactive; 11-17-2007 at 11:58 AM.

  3. #3
    Join Date
    Nov 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Tnx A LOT

    Tnx a lot my friend! It's a very good example.

  4. #4
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    You must use php, you cant do that with html only.
    Instead of using PHP you can accomplish your task using JavaScript.

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
  •