On submit- open in I-Frame

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Andy128
    Major General

    • Dec 2005
    • 2317

    On submit- open in I-Frame

    I have a form which has but a single field. That field will be filed in with a UID (unique identification number) and upon submit- I have written a php code that will retrieve that file, open it and present the data in a table.

    Question- how do I get it to display in the I-Frame? Since the form submit is actually going to the php page- how do I set the target to the specified I-Frame?

    Is there a an html code to place in the begining of the page to make it open in the specified I-Frame?

    Andy
    PHP- is a blast!
  • navaldesign
    General & Forum Moderator

    • Oct 2005
    • 12080

    #2
    Re: On submit- open in I-Frame

    Andy, you need total 3 pages to do this.
    1. the form page
    2. Then, i suppose that you have a page, with the script that retreives the UID and then retreives the file and displayes the data in the table. Let's call it "script.php". In the very start of your php code, add this php line:

    <?
    $UID = $_GET[UID];
    ... rest of your script..
    ..............................
    ?>

    At this point the script has received the UID, no need to receive it through the form.


    Normally, with the latest versions of php, $UID is already defined and available, but just to make sure, add this line.

    3. The page with the inline frame, which must also be published as php:

    Ok, in the 3rd page, in Start of Page, place the php code that receives the POST variables:

    <?
    $UID = $_POST[UID];
    ?>
    Then, in 3rd page, in the iframe properties, provide as Initial URL, to open in the iframe
    " script.php?UID=<? echo $UID ; ?>"

    the script page will open in the iframe of the third page, with the data of the specific file, related to the UID that has been posted from the first page.

    Please note that the first page can be combined with the 3rd one if you have the appropriate "flags" that will control the flow of the code and the display of the inline frame in the page (a simple if... else.. structure). In that case the form page will submit to itself, otherwise it must have as action the 3rd page
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

    Comment

    • Andy128
      Major General

      • Dec 2005
      • 2317

      #3
      Re: On submit- open in I-Frame

      Cool! Thanks Naval- I will giver her a go...............

      Andy
      PHP- is a blast!

      Comment

      Working...
      X