The File has been uploaded!
'; } else { //Couldn't move the file over. echo 'The file could not be moved.
'; $i = ''; } $i = $_FILES['image']['name']; } else { $i = ''; } //Check for a size (not required). if (!empty($_POST['size'])) { $s = escape_data($_POST['size']); } else { $s = 'Size information not available.'; } //Check for a price. if (is_numeric($_POST['price'])) { $p = $_POST['price']; } else { $p = FALSE; echo 'Please enter product\'s price!
'; } //Check for a description (not required). if (!empty($_POST['description'])) { $d = escape_data($_POST['description']); } else { $d = 'No description available.'; } if ($pn && $p) { // Add the print to the database. $query = "INSERT INTO product (name, price, size, description, image_name) VALUES ($pn, $p, '$s', '$d', '$i')"; if ($result = @mysql_query ($query)) {//Worked. echo 'The print has been added.
'; } else { //If the query did not run OK. echo 'Your submission could not be processed due to a system error.
'; } } else { //Failed a test. echo 'Please click "back" and try again.
'; } } else { //Display the form. ?>