Welcome to WebmasterWorld Guest from 18.206.168.65

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

How To Generate an XHTML Form with PHP

     
2:26 am on Feb 14, 2006 (gmt 0)

New User

10+ Year Member

joined:July 29, 2003
posts:34
votes: 0


-------
Feb 13, 2006

Given a list of catalog items contained in a comma delimited text file like this:

item_1_name, item_1_shape, item_1_color
item_2_name, item_2_shape, item_2_color
item_3_name, item_3_shape, item_3_color
.
.
.
item_n_name, item_n_shape, item_n_color

how can PHP be used to read the text file and then produce a typical XHTML form? The form would look something like this in the browser:

Item 1 -- Square -- Red ---- [Quantity Box]
Item 2 -- Circle -- White -- [Quantity Box]
Item 3 -- Star ---- Blue --- [Quantity Box]
.
.
.

The quantity boxes are the typical XHTML form input boxes wherein a website visitor can enter an integer.

Ambassador
-------

4:32 pm on Feb 15, 2006 (gmt 0)

Administrator

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
posts:12548
votes: 2


Do you know how to code it in XHTML first? The next step then would be to open and read the text file into memory. Then loop through the data, applying the XHTML to each iteration of the loop.