If you want them to preview then commit, simply give the SEND PHOTO TO
SERVER button a name like:

<input type=button NAME="send_photo" value="SEND PHOTO TO SERVER">

then in your code you can simply check for $_POST['send_photo'] before
calling the function that saves the image like:

if($_POST['send_photo']){
   // call the upload and add to database function.
   upload_image();
}

-----Original Message-----
From: Artoo [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 11, 2003 12:46 AM
To: [EMAIL PROTECTED]
Subject: [PHP] adding confirmation to an existing upload form

Hi,

I have an upload script in which the user selects an image to upload,
and a
brief description.  I would like to have some kind of  confirmation
that
allows the user the ability to upload the file and description or go
back
and make changes.

I was thinking of adding  to the beginning of the "upload.php" script a
thumbnail of the image and the short description followed by two buttons
<input type=button value="SEND PHOTO TO SERVER"> and <input type=button
value="MAKE CHANGES"> before the call to the function that actually
uploads
the image and saves the description in a database.  But I'm not sure how
to
pause the execution of the script at this point and wait for the user to
press either button before continuing the rest of the script.   Do I set
up
a variable that I keep polling until either button is pressed?  If the
user
presses the SEND PHOTO TO SERVER button I would continue with the rest
of
the script to send the file to the server and save the description to
the
database.   Otherwise I would return to the upload form.

Is there a better way to accomplish this?

Thanks



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to