print_r($_POST); print_r($_FILES); exit(); if (!isset($_POST['img1'])) { // header("Location: http://www.formularysolutions.com/imgtag/uploadimage.htm"); echo "file not found"; exit; } else { $img1 = $_POST['img1']; } $db = mysql_connect("www.btswebstores.com", "nonformulary", "nfml-59287") or die("Can't connect to server."); mysql_select_db("nonformulary", $db) or die("Can't select database."); $binary_junk = addslashes(fread(fopen($img1, "r"), filesize($img1))); //$insert_data = "INSERT INTO WebDatanf ( size, type, Description , BinaryColumn) //VALUES ('$img1_size', '$img1_type', '$img1_name', '$binary_junk')"; $insert_data = "INSERT INTO webdatanf2 ( BinaryColumn, Description, size, type) VALUES ('" . $binary_junk . "', '$img1_name', '$img1_size', '$img1_type')"; //echo $insert_data; mysql_query($insert_data) or die("Couldn't insert data."); ?>