though I'd ask for some advice before I start !
I have a script which uploads 5 images to a dir, and inserts the image path into an SQL db.
Taken me a while to learn how to do this with a multiple form and a foreach() loop but I got there
So now I'd like to add the ability for users to comment on the images they are about to upload.
I've added text areas next to each filefield button and they are all named textarea[].
And then I'm stuck - never dealt with textfields before, never inserted text into a DB so where do I start ?
For instance, with the image upload script I use thi to get going:
Code: Select all
for ($i=0;$i<5;$i++)
{
if ((!empty($_FILES['userfile'])) && ($_FILES['userfile']['error'][$i] == 0)){
$image = $_FILES['userfile']['name'][$i];
$filename = stripslashes($_FILES['userfile']['name'][$i]);
$extension = getExtension($filename);
$extension = strtolower($extension);
etc etc etc
Grateful for any links, tips, tricks, pointers or samples !
Best wishes
Monty