$alttext = $_POST['alttext']; $file_type = $_FILES['userfile']['type']; $tmp_file_name = $_FILES['userfile']['tmp_name']; $file_name = $_FILES['userfile']['name']; $uploaddir = '../' . $upload_dir; if ($file_name != "") { $upload = new upload_image($file_type, $tmp_file_name, $file_name, $uploaddir, $max_file_size); $upload->upload(); $upload->get_upload_directory(); $upload->get_message(); $filename = $upload->get_uploaded_file(); $photo = new stockphoto(); $photo->updateImage($post_imgID, $upload->upload_dir . $upload->file_name, $photoby, $caption, $alttext); } else { $photo = new stockphoto(); $photo->updateImage($post_imgID, "", $photoby, $caption, $alttext); $info = $photo->getImageDetails($post_imgID); $file_name2 = $info[0]->image_filename; $photoby = $info[0]->image_photographer_author; $caption = $info[0]->image_captions; $alttext = $info[0]->image_alttext; echo "<script>alert('Successfully saved the image.');window.close();</script>\n"; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Image Details</title> </head> <body>