Good Evening everyone,

I am hoping this is the proper place to post this question, might not be but im not really sure where to go with this one. I am working on a website for my company which will be based on our Intranet, and was wondering if there is a way for a page to display file contents.

Example. User runs a report that and comes up with user statistics. (excel document most likely) They would drop the file into /folder/folder/file.xls The website would take the contents of file.xls and display it on the website, this way each day the file is updated, the page will display the new stats.

Any help would be appreciated. Any questions just let me know.

Thanks in advance!

Recommended Answers

All 2 Replies

html wont be able to do this but php5+ could.

What you would need to do is to import it into mysql through phpmyadmin. You could then use php to present the data.

depends on the complexity of the data, and whether you expect to be able to manipulate it online
If the importand information is a static table of information its a piece of cake
have the script that creates the report output it to a .csv file, with the correct name (same name every day)
a php script to display the datafile as a table

<!-- other html -->
<table border="0" cellpadding="0" cellspacing="1">
<?php $row = 1;
$handle = fopen("dailyreport.csv", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
 $num = count($data);
 $row++;
if ($row == 2) {
 echo "<thead>\n<tr>\n";
  for ($c=0; $c < $num; $c++) 	{  echo "<th >" . $data[$c] . "</th>\n";  }
echo "</tr>\n</thead>\n<tbody>"; 
}
else {
echo "<tr>\n";
for ($c=0; $c < $num; $c++) {
echo "<td>" . $data[$c] . "</td>\n";
}
echo "</tr>\n";
}
}
fclose($handle); ?>
</tbody>
</table>
<!--other html -->

crappy code, but it runs
file upload scripts abound, the script above requires the upload script uploads "dailyreport.csv" to the same folder
security is not considered, but should be in any production version

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.