Jump to content

Archived

This topic is now archived and is closed to further replies.

aaronrb

would this be the correct way to do this

Recommended Posts

Hello

i would liek to know if this is the correct way to work on my project before i spend loads of time working on it and it doesnt work.

i woudl like to create a huge list so that me and my friends can add the films that we own.

i would liek the first page to have a text box or a drop down menu so that they can select how many films they wanna add at any one time.

and then it will move on to the next page with that desired amount of textboxes.

now the way that i would image this was done, was to use a foeeach statement.
would i be right in saying this??

and also if this is the way, as i have never used this before how would i go about adding it to mysql db.

thanks in advance.
Regards
A

Share this post


Link to post
Share on other sites
Well a for statement would make more sense for this situation.

[code]$numBoxs = $_POST['boxes'];
for ($i=1;$i<=$numBoxes;$i++) {
echo "<textarea name='box".$i."' rows=5 cols=50></textarea><br />";
}[/code]

This would make the number of text boxes and have them named box1,box2,box3,etc.

As for adding them to a mysql database, that depends on how your database is built.

-shimano55

Share this post


Link to post
Share on other sites
thanks for that, adding them to database,
i would liek tthe name of hte film, an autonumber which will be the film number, and the catergory of the film.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.