The directory is being made, but the image is being placed in the /products/ folder instead of /products/$id/ folder... any ideas I would really appreciate it
require_once('../variables.php');
$db = @mysql_connect($GLOBALS['database_server'], $GLOBALS['database_username'], $GLOBALS['database_password']);
@mysql_select_db("meetweb_catlow");
if(isset($_POST['add']) && $_POST['add'] == 'Add') {
$id = $_POST['id'];
$category_id = $_POST['category_id'];
$title = mysql_real_escape_string($_POST['title']);
$main_description = $_POST['main_description'];
$sub_description = $_POST['sub_description'];
$features = $_POST['features'];
$benefits = $_POST['benefits'];
$materials = $_POST['materials'];
$accessories = $_POST['accessories'];
$image = $_POST['image'];
$sql = "insert into products values('', '$category_id', '$title', '$main_description', '$sub_description', '$features', '$benefits', '$materials', '$accessories', '$field3_text', '$field4_title', '$field4_text')";
@mysql_query($sql);
$last_id = mysql_insert_id();
$old_umask = umask(0);
mkdir("../products/$last_id",0777);
umask($old_umask);
$upload = "../products/$id/image.jpg";
move_uploaded_file($_FILES['image']['tmp_name'], $upload);
echo "<meta http-equiv=\"Refresh\"content=\"0; URL=index.php\">";
}