Hello all,
I am very new to php but I have coded most of a script for my site to have a Saltwater Aquarium Fish and corals Database.. I am stuck at the picture uploading and renaming part.. the following code doesn't give any errors but it also doesnt upload a picture either.. I am not sure what I am doing wrong and every example I look at seems to confuse me even more.. so if anyone can point out to me whats wrong with the following code I would be happy as a pig in ****. 🙂
$sql = "INSERT INTO ".$prefix."_tri_profiles (category,scientific,common,description,origin,size,temp,sg,diet,ph,hardy,skill) VALUES ('$category','$scientific','$common','$description','$origin','$size','$temp','$sg','$diet','$ph','$hardy','$skill')";
$result = mysql_query($sql);
$id = mysql_insert_id();
$jpg = $id.".jpg";
$base_dir = "C:\apache\htdocs\nuke\images\profiles";
if ($_FILES['image']['type'] != 'image/gif') {
copy($_FILES['image']['tmp_name'], "$base_dir/$jpg");
header("Location: admin.php?op=profiles");
}
}