Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Display .txt file content as an Input

Reply
Thread Tools

Display .txt file content as an Input

 
 
Rhonda
Guest
Posts: n/a
 
      09-15-2005
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.


 
Reply With Quote
 
 
 
 
Mark Parnell
Guest
Posts: n/a
 
      09-15-2005
In our last episode, Rhonda <(E-Mail Removed)> 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/
 
Reply With Quote
 
 
 
 
Rhonda
Guest
Posts: n/a
 
      09-15-2005
"Mark Parnell" <(E-Mail Removed)> wrote in message
news:4328f76a$0$12687$(E-Mail Removed)...
> In our last episode, Rhonda <(E-Mail Removed)> 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.


 
Reply With Quote
 
Oli Filth
Guest
Posts: n/a
 
      09-15-2005
Rhonda wrote:
> "Mark Parnell" <(E-Mail Removed)> wrote in message
> news:4328f76a$0$12687$(E-Mail Removed)...
> > 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

 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      09-16-2005
In our last episode, Rhonda <(E-Mail Removed)> 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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error: Only Content controls are allowed directly in a content page that contains Content controls. hazz ASP .Net 6 06-09-2010 01:54 PM
how read content from file in form input type=file Rafal\(sxat\) Javascript 5 05-26-2009 04:07 AM
How to upload an <img> content without <input type=file > ? SammyBar Javascript 3 01-12-2007 03:57 PM
Display the content of .Doc file using JSP in html page Rahul Java 4 12-22-2006 04:49 PM
display content of html-file in table-column ??? Chris HTML 10 06-14-2004 04:57 PM



Advertisments