$bannerID = $_SESSION['bannerID']; $file_type = $_FILES['userfile']['type']; $tmp_file_name = $_FILES['userfile']['tmp_name']; $file_name = $_FILES['userfile']['name']; $upload_dir = '../../images/ads/'; $msize = ini_get('post_max_size'); $max_file_size = $msize; // found problem here... $photo = new stockphoto(); if (isset($_FILES) && isset($_POST['fileupload'])) { $upload = new upload_image($file_type, $tmp_file_name, $file_name, $upload_dir, $max_file_size); $upload->upload(); $upload->get_upload_directory(); $upload->get_message(); $filename = $upload->get_uploaded_file(); $photo->addNewImage($upload->upload_dir . $upload->file_name, '', '', ''); $photo->addImageToClient($clientID); //$photo->updateBannerClient( $bannerID ); $_SESSION['insertclientID'] = $photo->insertclientID; // Get the newly inserted id } ?> <!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>Upload a file</title> </head> <body> <link rel="stylesheet" type="text/css" href="../../templates/admin2.css" /> <table > <form method="post" action="uploadimage3.php" enctype="multipart/form-data" name="filename">
$file_name = $_FILES['userfile']['name']; $uploaddir = '../' . $upload_dir; $photoby = $_POST['photoby']; $caption = $_POST['caption']; $alttext = $_POST['alttext']; $msize = ini_get('post_max_size'); $max_file_size = $msize; print_r($_SESSION['article_imgs']); if (isset($_FILES) && isset($_POST['fileupload'])) { $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->addNewImage($upload->upload_dir . $upload->file_name, $photoby, $caption, $alttext); $id = $photo->insertID; $_SESSION['article_imgs'][$id] = $id; //$photo->insertImageToArticle( $_SESSION['articleID']); } ?> <!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>Upload Image</title> </head> <body> <link rel="stylesheet" href="../../templates/admin2.css" type="text/css" /> <table class="adminform" > <form method="post" action="uploadimage.php" enctype="multipart/form-data" name="filename"> <tr class="table_header">