Display .txt file content as an Input

Discussion in 'HTML' started by Rhonda, Sep 15, 2005.

  1. Rhonda

    Rhonda Guest

    I'm trying to display a stored text document(number) as an Input on a form.
    I can display the number/value as follows using iframe:

    <iframe src="counter.txt" width="50" height="20" frameborder="0" border="0"
    scrolling="no" marginheight="0" marginwidth="0"></IFRAME>

    But I can't find the syntax to populate Input, like:
    <input type="text" name="order_num" src="counter.txt"" /></td></tr>

    I must populate a named Input with my value for my PHP script to process it
    with my other form fields.

    Any suggestions appreciated.
    Rhonda, Sep 15, 2005
    #1
    1. Advertising

  2. Rhonda

    Mark Parnell Guest

    In our last episode, Rhonda <> pronounced to
    alt.html:

    > <input type="text" name="order_num" src="counter.txt"" /></td></tr>


    Since the src attribute doesn't exist for <input> elements, it's not
    surprising the above doesn't work.

    Since you're using PHP already:

    <input type="text" name="order_num" value="<?php include("counter.txt");
    ?>">

    --
    Mark Parnell
    http://clarkecomputers.com.au
    alt.html FAQ :: http://html-faq.com/
    Mark Parnell, Sep 15, 2005
    #2
    1. Advertising

  3. Rhonda

    Rhonda Guest

    "Mark Parnell" <> wrote in message
    news:4328f76a$0$12687$...
    > In our last episode, Rhonda <> pronounced to
    > alt.html:
    >
    > > <input type="text" name="order_num" src="counter.txt"" /></td></tr>

    >
    > Since the src attribute doesn't exist for <input> elements, it's not
    > surprising the above doesn't work.
    >
    > Since you're using PHP already:
    >
    > <input type="text" name="order_num" value="<?php include("counter.txt");
    > ?>">
    >
    > --
    > Mark Parnell
    > http://clarkecomputers.com.au
    > alt.html FAQ :: http://html-faq.com/


    That syntax produced: [ <?php include( ] in the input field, and
    ?>">
    outside of the input.
    Rhonda, Sep 15, 2005
    #3
  4. Rhonda

    Oli Filth Guest

    Rhonda wrote:
    > "Mark Parnell" <> wrote in message
    > news:4328f76a$0$12687$...
    > > Since you're using PHP already:
    > >
    > > <input type="text" name="order_num" value="<?php include("counter.txt");
    > > ?>">

    >
    > That syntax produced: [ <?php include( ] in the input field, and
    > ?>"> outside of the input.


    Change the HTML file to a .php extension.

    --
    Oli
    Oli Filth, Sep 15, 2005
    #4
  5. Rhonda

    Mark Parnell Guest

    In our last episode, Rhonda <> pronounced to
    alt.html:

    > That syntax produced: [ <?php include( ] in the input field, and
    > ?>">
    > outside of the input.


    Ah, I misunderstood your setup (a good reason to include a URL). The
    page containing the form will need to be a PHP file, as well as the
    script that processes the form submission.

    --
    Mark Parnell
    http://clarkecomputers.com.au
    alt.html FAQ :: http://html-faq.com/
    Mark Parnell, Sep 16, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Gray

    Display txt file

    Peter Gray, Dec 8, 2003, in forum: HTML
    Replies:
    8
    Views:
    32,120
    Voetleuce en f?nsievry
    Dec 9, 2003
  2. hazz
    Replies:
    6
    Views:
    49,382
    SkyUCHC
    Jun 9, 2010
  3. cyberco
    Replies:
    6
    Views:
    676
    John Machin
    Nov 20, 2006
  4. Sameen
    Replies:
    2
    Views:
    421
    Victor Bazarov
    Aug 29, 2005
  5. Jochen Brenzlinger
    Replies:
    7
    Views:
    5,468
    Roedy Green
    Sep 15, 2011
Loading...

Share This Page