Jump to content

HOWTO make a "smart" form with extendable numbers of fields ??


Michael_zz

Recommended Posts

Hiiiiiii php coders  8)

 

I'm trying to make a gallery script that have 2 sides .. control panel and a public area using php and mysql database ..

my problem now is how to make a 'smart' form in the control panel area that can extend it's input fields so that users can add many photos at once  :confused:

I mean preforming many queries at once all dumping at the same table , but with dynamically set variables ( like $something = $_POST['something'] ) .. hope you get the point :-\ ..

I've googled about it but couldn't find anything useful enough

 

thanks in advance  :D

How do you mean by a "smart" form, and also what do you mean by adding photo's?

 

If you are talking about uploading photo's, and then sending the pic's data to the database, then you can just use a normal upload form and then loop the FILES global and do it that way. more on that here...

 

If your talking about editing the values already held in the database, again a simple loop will do, just select the column names and populate a form with the values.

Hiii ferdi .. thanks for replying :)

 

sorry for being not clear enough .. but in other words I want a button , when pressed , generate a bit of php code that will display new fields beside the ones already present in the form ..

 

I want to use this code to insert the new text fields ..

<input type="text" name="title[]" value="" id="title" >

this code will returrn an array containing all variables of the "title" text field .. so I want some code that can dynamically make these new fields via clicking a button or something ..

thanks for your help , I appreciate that

 

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.