Jump to content

would this be the correct way to do this


aaronrb

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
Link to comment
https://forums.phpfreaks.com/topic/8198-would-this-be-the-correct-way-to-do-this/
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

Archived

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

×
×
  • Create New...

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.