Hi,
I have a script that allows a user to upload an image, and store that value in a database. If there is already a value in the database the script reverts to a section that allows the user to 'delete' the image and upload another one. In order to retrieve the image from a folder I am using a hidden field in some html to echo the file name then pull that into $_FILES ['imagefile']. The problem is that from the script below I get an undefined index on 'imagefile:'
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<form name="form1" method="post" action="" enctype="multipart/form-data">
<input type="hidden" name="imagefile" value="<?php echo $image1; ?>">
<p> </td><td><input name="submit" type="submit" value="Submit"></p>
</table>
</form>';
// exit;
//move image1 to the delete folder.
echo "$image1";
if(isset( $submit ))
{
if ($_FILES['imagefile'] == "$image1"){
echo "$image1";
If you need anything else, please let me know.
Thanks,
G