Okay... I'm trying to upload images into a directory on a server... cannot get it to work! As you can tell, I'm working in dreamweaver... mx 2004 specifically. This is my first attempt at doing an image upload. Connections are taken care of in another php file, so those are all good. all of my other insert record forms work perfectly. this one... not so much. Any help is greatly appreciated!
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$uploaddir = '/kunden/homepages/27/d12459488/htdocs/pictures/';
$filename = $_FILES['PictureFileName']['name'];
$uploadfile = $uploaddir.$_FILES['PictureFileName']['name'];
$msg = '';
if (move_uploaded_file($_FILES['image_filename']['tmp_name'], $uploadfile)) {
$msg = 'File uploaded';
$insertSQL = sprintf("INSERT INTO tblPictures (PictureTitle, PictureFileName, PictureCaption, RiderID, PictureDate) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['PictureTitle'], "text"),
GetSQLValueString($filename, "text"),
GetSQLValueString($_POST['PictureCaption'], "text"),
GetSQLValueString($_POST['RiderdID'], "int"),
GetSQLValueString($_POST['PictureDate'], "date"));
mysql_select_db($database_mpracing, $mpracing);
$Result1 = mysql_query($insertSQL, $mpracing) or die(mysql_error());
} else {
$msg = 'File could not be uploaded!';
}
}
Also, I've double checked all the values in my html form. those are all fine.
Oni