<form action="" method="post" enctype="multipart/form-data">
<input type="file" name="excelfile">
<input type="submit" name="upd" value="Upload">
</form>
I want to upload sample.xls
this is my upload script.
<?php
if(isset($_POST["upd"]))
{
$file = $_FILES['excelfile']['tmp_name'];
$handle = fopen($file, "r");
$c = 1;
$heading = true;
while(($filesop = fgetcsv($handle, 1000, ",")) !== false)
{
if($heading) {
$heading = false;
continue;
}
echo "<tr><th>".$c."</th><th>".$filesop[0]."</th></tr>";
$c = $c + 1;
}
}
?>
Here is the output screenshot http://screencast.com/t/RqZWnz1y
CSV files works correctly..
How to solve this problem?