Results 1 to 4 of 4

Thread: coding for directing links to various iframe in a same html file

  1. #1
    Join Date
    Jan 2010
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default coding for directing links to various iframe in a same html file

    I am not sure if it is a question for javascript to make it work, but I give it a try here.

    I have a flash page containing 3 different links, when each is clicked, it is supposed to send visitor to a html file displaying an <iframe> contents. Currently, I am doing a foolish way by making 3 separate html files. The difference among them is only that line has iframe in it. Do you think whether it can be programmed to be inside one html file but recognized the connection between the links in flash and the iframes they direct to.


    Here are the iframes I have inside the html page

    <iframe width="100%" height="550" frameborder="0" src="/portfolio/index.html?openfolder=1"></iframe>

    <iframe width="100%" height="550" frameborder="0" src="/portfolio/index.html?openfolder=2"></iframe>

    <iframe width="100%" height="550" frameborder="0" src="/portfolio/index.html?openfolder=3"></iframe>

    I attach a stretch of what I thought.

    Thank you.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    It cannot be programmed in an HTML file, but it can be programmed in a PHP file - check to see if your host supports PHP.
    Jeremy | jfein.net

  3. #3
    Join Date
    Jan 2010
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Yes, my host does support php. how do I code though... Thank you.

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Ok, then give this a try:
    PHP Code:
    <?php
    if(isset($_GET['page'])){
        switch(
    $_GET['page']) {
          case 
    "1":
            echo 
    '<iframe width="100%" height="550" frameborder="0" src="/portfolio/index.html?openfolder=1"></iframe>';
          break;
          case 
    "2":
            echo 
    '<iframe width="100%" height="550" frameborder="0" src="/portfolio/index.html?openfolder=2"></iframe>';
          break;
          case 
    "3":
            echo 
    '<iframe width="100%" height="550" frameborder="0" src="/portfolio/index.html?openfolder=3"></iframe>';
          break;
          default:
            echo 
    "Page not found!";
          break;
        }
    }
    ?>
    Jeremy | jfein.net

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
  •