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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

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.