troubleshooting Question

How do I Import CSV File In my PHP Application

Avatar of peter-cooper
peter-cooper asked on
29 Comments1 Solution1229 ViewsLast Modified:
I need to upload a csv file to php, parse the file and place the contents in a select element. I have tried various ways after searching google, but noting seems to work. This is new to me and would appreicate any help.

I have the html done but struggling to cope with php parsing of the file and populating select.

I would be grateful if someone could show me how to proceed with this as this would be my first time at handling this type of event. many thanks

<form enctype="multipart/form-data" action="somepage.php" method="post" id="upload"> 
        <table cellpadding="5" cellspacing="0" width="500" border="0"> 
                <td class="width"><label for="image">Upload CSV file : </label></td> 
                <td><input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
                <input type="file" name="csvfile" id="csvfile" value=""/></td> 
                <td><input type="submit" name="uploadCSV" value="Upload" /></td> 
Join our community to see this answer!
Unlock 1 Answer and 29 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 29 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros