38 users online (0 members and 38 guests)  

Thread: PHP Iframe help


  Results 1 to 3 of 3

Related

  1. IFrame in PHP?    Forum: PHP Forum
    Replies: 1
  2. iframe    Forum: HTML Forum
    Replies: 4
  3. Php and Iframe    Forum: PHP Forum
    Replies: 3
  4. iframe    Forum: HTML Forum
    Replies: 2
  5. IFRAME    Forum: HTML Forum
    Replies: 14
  1. #1
    The !jb's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2004
    Posts
    1

    Question PHP Iframe help

    ok, here's the deal, I have a site and on that site I have an iframe I allso have links to other pages on the same site, I want to shange the source of the ifreme to a predefined variable like so:
    PHP Code:
    <?php
    $varri 
    "iframe.htm";
    ?>

      <iframe src=<?php print $varri?> scrolling="auto" width=100% height=100% frameborder="0"> </iframe>
    so, when you click on a link then the variable varri should be changed to the correct page name, if I clicked on News then it would be changed to news.html
    how do I do this, or is this at all possible ?

    //sorry for my bad english

  2. #2
    paul9038's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2004
    Posts
    8

    Iframe control

    I used the following code to load a different iframe depending on a users login. Something similar would work in your case.

    if($ValidUser == "Administrator"){
    //Load the administration modules into an iframe.
    echo"<iframe SRC=\"phpmyadmin/index.php\" width=\"100%\" height=\"100%\" frameborder=\"0\">If you can read this your browser does not support iframes.</iframe>";
    } else {
    //Load the standard module into the iframe.
    echo"<iframe SRC=\"TutIntro.php\" width=\"100%\" height=\"100%\" frameborder=\"0\">If you can read this your browser does not support iframes.</iframe>";
    }?>

    Hope this helps.

  3. #3
    toat01's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2009
    Posts
    1

    Re: PHP Iframe help

    yuo most putin the full url

    PHP Code:
    <?php 
    $varri 
    "http://www.myhost/iframe.htm"
    ?> 

      <iframe src=<?php print $varri?> scrolling="auto" width=100% height=100% frameborder="0"> </iframe>



Tags for this Thread