friends i already know how to upload .csv file format through php. but now i need to know how to upload .xls file in php. i tried of this code but it doesn't work properly.. can any one able to give suggestion for me??
if ($_POST['frmSubmit']) {
$file = $_FILES['frmUpload']['name'];
if ($file) {
$data = new Spreadsheet_Excel_Reader();
$data->read('name'.$file);
for ($k = 1; $k < count($strDatas->sheets[0]['numRows']); $k++) {
$name = $data->sheets[0]['cells'][$k][1];
$code = $data->sheets[0]['cells'][$k][2];
$email = $data->sheets[0]['cells'][$k][3];
$designation = $data->sheets[0]['cells'][$k][4];
$number = $data->sheets[0]['cells'][$k][5];
$salary = $data->sheets[0]['cells'][$k][6];
$age = $data->sheets[0]['cells'][$k][7];
doInsertEmployeeDetails($name, $code, $email, $designation, $number, $salary, $age);
}
} else {
$strMessage = 'Please upload a valid file.';
$strClass = 'Error';
}
}