I would really appreciate if someone could help me here, I am quite the noob with php or any of this stuff.
I am trying to upload a php file. I have tried both localhost and a web server and I get the same error in both. This is the error from the web server, on localhost it doesn't specify which lines.
Notice: Undefined index: image in >/storage/ssd4/613/5272613/public_html/hq.php on line 5
Notice: Undefined index: image in >/storage/ssd4/613/5272613/public_html/hq.php on line 6 There was an error uploading the file
The first 12 lines of my code look like this:
<?php
//UPLOAD IMAGE TO SERVER
$target_path = "./";
$target_path = $target_path . basename($_FILES['image']['name']);
if (filesize($_FILES['image']['tmp_name']) > 1000 && move_uploaded_file($_FILES['image']['tmp_name'], $target_path)) {
//echo "The file ". basename( $_FILES['image']['name'])." has been uploaded\n";
} else {
die("There was an error uploading the file\n");
}
I believe the error should be inside there somewhere, as I said I am really stuck and have no clue how to advance here. Any input would be hugely appreciated!