Jump to content

File Read Script


ajannick

Recommended Posts

Hi,

 

I have a Excel File Reader script that works perfectly on my private development hosting, the Excel file is read and then the contents are displayed to the page with the help of a for loop.  The trouble is when I try it out on my work's hosting space the script does nothing, no error messages or anything.  I have not changed anything and all paths ect are correct.

What else could be causing this?

 

Many Thanks,

 

Link to comment
Share on other sites

the script does nothing

 

Producing even a blank page is something and is a symptom that helps point to the cause of the problem. What exactly occurs in front of you when you try it? And if you do get a blank page, what does the 'view source' in your browser show?

 

Do you have php's error_reporting set to E_ALL and display_errors set to ON so that php would report and display any errors it detects?

 

Beyond that, you would need to post the code so that someone could see what it is doing that might be server or server configuration specific.

Link to comment
Share on other sites

Hi,

 

The script runs and seems to stop at the line - $data->read('Senator.xls');

 

When the page source is viewed the doc tag and open/close body and html tags are there but nothing in between.

 

The script is below:

 

<?php

require_once 'Excel/reader.php';

 

$data = new Spreadsheet_Excel_Reader();

 

$data->read('Senator.xls');

 

error_reporting(E_ALL ^ E_NOTICE);

 

echo "<table border='1'>";

 

echo "<tr><th>First Name</th><th>Middle Name</th><th>Last Name</th><th>Email ID</th></tr>";

 

for ($j = 1; $j <= $data->sheets[0]['numCols']; $j++)

 

                                {

echo "<tr>";

           

 

echo "<td>";

 

                                echo $data->sheets[0]['cells'][$j+1][1];

 

echo "</td>";   

 

echo "<td>";     

 

                                echo $data->sheets[0]['cells'][$j+1][2];

 

echo "</td>";

 

echo "<td>";

       

 

                                echo $data->sheets[0]['cells'][$j+1][3];

 

echo "</td>";

 

 

echo "<td>";

                                echo $data->sheets[0]['cells'][$j+1][4];

 

echo "</td>";

                                //echo "<br>";

 

echo "</tr>";

 

  }

 

 

echo "</table>";

 

?>

 

What checks could be done or changes made to the configuration of the server?

 

 

Many Thanks,

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.