Hello.
I have this script where the user selects a file, adds a caption and description and hits submit.
I then adds the file to my gallery folder, and adds the url/path, as well as the caption and description to a mysql database.
I have the database part of it working, but I can not get it to upload the file....
Can someone tell me what I am doing wrong please?
if($_SESSION['bspmich'] == 1){ //if user is logged-in
if($_GET['action'] == "upload"){ //if action == upload ex: http:///mysite/com/gallery.php?action=upload
$image_title = cleanstring($_POST['img_name']); // Get the name from the form
$image_caption = cleanstring($_POST['img_caption']); // Get the caption from the form
$target_path = "gallery/".basename($_FILES['ufile']['name']); // Set the path
move_uploaded_file($_FILES['ufile']['tmp_name'], $target_path); //upload the file?
mysql_query("INSERT INTO images (title, description, url) VALUES('$image_title', '$image_caption', '$path') ") or die(mysql_error()); //insert the image title, caption, and path..
soft_redirect("gallery.php"); // redirect back to gallery.php
}
}
If anyone can help, I would greatly appreciate it.
Thanks,
EliteAce