Hello, I'm using a function for uploading images on the server and database. The only problem is that I can not properly put to the various alerts for required fields or missing and with happened insertion message.
For the moment my code, obviously wrong, is so:
include_once 'function/upload.php';
if(isset($_POST['submit'])) {
if(empty($_POST['title'])){
$error = "Manca il titolo";
}
if(empty($_POST['description'])){
$error = "Manca la descrizione";
}
if(!empty($_FILES['image']['name'])) {
//call thumbnail creation function and store thumbnail name
$upload_img = imgUpload('image','uploads/','',TRUE,'uploads/thumbs/','260','260');
//full path of the thumbnail image
$thumb_src = 'uploads/thumbs/'.$upload_img;
$success = "Caricato!";
}
}
Which is the right syntax to write the errors in this case?