Not uploading csv or excel to mysql

						It was working fine until recently when I modify it and forgot 

what I did frankly. It should import csv or excel to a database, thats



see simple, nothing complicated, I’m sure I made a trivial error as always, just can’t see it

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.

actually i didnt forget to close the string in my file, i forgot to close it in pastbin so it’s not causing anything in my project

and upload.php is called from Footer.php

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?)

did that and aslo ini_set(‘display_errors’, true); // set to false for production

not seeing anything

You var_dumped $_FILES and arnt seeing ANYTHING? Even if you dont send any files, $_FILES should be an array that outputs something when var_dump’d…

Copied your code from pastebin and here is the result:
array (size=1)
‘MAX_FILE_SIZE’ => string ‘9999999’ (length=7)

array (size=1)
‘file’ =>
array (size=5)
‘name’ => string ‘inperon-test.pdf’ (length=16)
‘type’ => string ‘text/pdf’ (length=8)
‘tmp_name’ => string ‘/private/var/tmp/phpf19Sod’ (length=26)
‘error’ => int 0
‘size’ => int 134977

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 ()?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.