I have a current web page using file upload with HTMl and PHP to read the CSV and insert into the database. This all works fine but I'm trying to find a fairly quick and painless way of showing the data to the user before submitting and inserting to the database. Right now my submit button posts to the PHP and immediately does a VAR dump and inserts to the DB. I'm hoping there's a fairly streamlined way to show it on the page as soon as the file is added to the upload box.
if(isset($_POST['submit']))
{
ini_set('auto_detect_line_endings', true);
$file = $_FILES["file"]["tmp_name"];
$handle = fopen($file, "r");
while(!feof($handle)){
$filesop = print_r(fgetcsv($handle, 0, ","));
}
$coldata = array();
$coldata[ "orderNumber" ] = $filesop[0];
$coldata[ "place" ] = $filesop[1];
$coldata[ "workOrderNum" ] = $filesop[2];
$coldata["lowSideMIUNum"] = $filesop[3];
//rest of array elements and insert statement