
CuzDesign
Deleted
Jun 6, 2000, 2:45 AM
Post #2 of 2
(110 views)
|
|
Re: Need help in adding data to the database
[In reply to]
|
Can't Post
|
|
Hello, You could do something like this to print the options to the drop down menu, this is of course if the item is in the data.txt fiel and is the first thing in possition, by a database file seperated with ":". If this is assuming from what you said you want to READ from the file after you have already added it and then print it to the drop down box. <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> print "<select name=\"data\" size=\"1\">\n"; print "<option selected>-----Please Choose------</option>\n"; open (DATA,"<data.txt") or die "Couldn't open data,txt $!\n"; while (<DATA> ){ chomp; my @list = split(/:/,$_); $entry = $list[0]; print "<option>$entry</option>\n"; } print "</select>\n"; </pre><HR></BLOCKQUOTE> Hope this helps. Regards, Ray [This message has been edited by CuzDesign (edited 06-06-2000).]
|