Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A looping form

Status
Not open for further replies.

jxfish2

Technical User
Jan 24, 2002
183
US
I've successfully created my first form.

I can enter the data, and the data displays just fine.

However, let's say that I was creating a large database, and manually entering data into it...

Let's say that it's similarly formatted data, over and over again...

Let's say that I wanted to enter the first record, then the second, third, etc... etc...

How would I get the loop to continue adding or processing data, until it encounters a Null value?

Would I use a <form action=&quot;?&quot;...

Would I use an <input type=&quot;Submit&quot;...

Any advice, especially if it contains understandable examples, would be greatly appreciated...

TIA

Joe
 
Not quite sure what you're asking, but

a) if you're wanting to enter the same record multiple times into the database, you can use a loop in php rather than going back to the user

b) if you're wanting to enter similar but not identical records into the database, simply redisplay your fields in your form after submission

Please clarify what you want to do...

-Rob
 
just put the action to the same script and before:

if ($_POST[submit]){
// do the insert
}

and then the FORM again ... Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Thanks Anikin,
Hi Rob,

In answer to your query, the following records need to be placed in a database, or flat file, and I have a form for entering the data:

Name Street City State Zip

J Doe 123 1st Oki MO 54321
G Moe 456 2nd Doki MO 54322
Curly 789 4th Smoki MO 54323

I want the form to loop continuously, until there is no more data to enter, or until the &quot;Name&quot; field is blank, at which point, it would exit on it's own, or commit the changes...

One last question...

How would I &quot;append&quot; these entries to the file, without overwriting what's already in the file?

TIA

Joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top