bellow u can see code, that i dont understand), how do that it work, i do across wampserver.https://i.stack.imgur.com/PVO9j.png
<?php
$target_dir = "lab/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
if (file_exists($target_file)) {
echo "File already exists.";
$uploadOk = 0;
}
if ($uploadOk == 0) {
echo "Error - file was not uploaded.";
} else {
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
echo "File". basename( $_FILES["fileToUpload"]["name"]). " was uploaded successfully.";
$to = "root@localhost";
$url = $_POST['current_url'];
$subject = "New image was uploaded";
$message = "URL:" . $url ;
$headers = "lab\r\n" . 'Content-Type: text/plain; charset=UTF-8';
mail($to,$subject,$message,$headers);
}
}
?>