Well the first problem is you didnt close your string on upload’s line 8. (The coloration of the rest of the file tells you that)
The second problem is that your index page doesnt actually have a file upload form.
Ah okay… so standard triage, cause nothing’s jumping out at me immediately as glaringly bad.
var_dump($_FILES) at the top of upload.php, make sure you’re getting the data through the form. That’ll at least tell you which file has gone wrong.
Second, make sure you’re not uploading a file that is bigger than 10 and a half megabytes, because upload is looking for a file smaller than that.
Once you’ve done that, start throwing echoes into the if statements - try doesnt catch “false” if conditions, so you’re looking for something that’s coming up false that shouldnt be. (is the file readable? Is it on the system?)
The first block is var_dump($_POST), and the second var_dump($_FILES).
Seems nothing is wrong with the php code.
The part I am worried about though is this:
onchange=“showCode()” onblur=“showCode()” onclick=“showCode”
Since I haven’t got the JavaScript code behind this I can’t test, but my guess would be that the onclick is messing things up. What is is supposed to do anyway? Maybe missing brackets ()?