I am new to PHP and learning PHP using Head First, as said in the chapter to upload a file I declared in HTML:
<input type = "file" name = "screenshot" id = "screenshot" />
And tried to read the name of the uploaded image file via PHP by:
$screenshot = $_FILES['screenshot']['name'];
but when I tried to upload a file following error occurs:
" Notice: Undefined index: screenshot in C:\xampp\htdocs\test\addscore.php on line 14 "
Kindly help me in finding the real cause as the index that is mentioned is same in both i.e. screenshot, also the size of the file is small then the declared max size.
maybe you can change logic to show the output form: initialize $output_form with true before the 1st if and set it to false when needed (will save you several lines)
I'm using a standard xampp installation (version 1.8.3).