never_rain Posted September 17, 2010 Share Posted September 17, 2010 I have an excel file that I want to show in PHP page. I dont want this to first download and then view. I want it something like gmail where you just click on the file name and it opens up. Can you please give me an idea as how to do this. Regards, Faisa Quote Link to comment https://forums.phpfreaks.com/topic/213641-embed-excel-file-into-php-page/ Share on other sites More sharing options...
lqdmindz Posted September 17, 2010 Share Posted September 17, 2010 I read somewhere, i think, that it is a headers issue. Also that is can be quite dangerous security wise. Quote Link to comment https://forums.phpfreaks.com/topic/213641-embed-excel-file-into-php-page/#findComment-1112003 Share on other sites More sharing options...
never_rain Posted September 17, 2010 Author Share Posted September 17, 2010 Well.. still I am looking for the solution.. any ideas how to show an Excel sheet in web page ? Quote Link to comment https://forums.phpfreaks.com/topic/213641-embed-excel-file-into-php-page/#findComment-1112007 Share on other sites More sharing options...
squiblo Posted September 17, 2010 Share Posted September 17, 2010 save the excel file as a web page, a few google searches will give you an idea what to do Quote Link to comment https://forums.phpfreaks.com/topic/213641-embed-excel-file-into-php-page/#findComment-1112048 Share on other sites More sharing options...
charles07 Posted January 5, 2012 Share Posted January 5, 2012 try this, but u should use .csv format instead of excel format <?php $cnx = fopen("example.csv", "r"); //open example.csv echo("<table style='border:1px solid #ddd;'>"); // echo the table while (!feof ($cnx)) { // while not end of file $buffer = fgets($cnx); // get contents of file (name) as variable $values = explode(",", $buffer); //explode "," between the values within the contents echo "<tr >"; for ( $j = 0; $j < count($values); $j++ ) { // echo("<td style='border:1px solid #ddd;'>$values[$j]</td>"); } echo"</tr>"; }; echo("</table>"); fclose($cnx); //close filename variable ?> Quote Link to comment https://forums.phpfreaks.com/topic/213641-embed-excel-file-into-php-page/#findComment-1304400 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.