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
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.