CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Basic PHP Question

Print topic Send  topic

Author Message
Richard Bryce
Posted: 04/15/2003, 6:15 PM

Hi All,
A pretty basic PHP question....

I pulled the following code down off www.php.net. When I put this into a
file (named test1.php) and try to run it I am getting some CGI error. Can
anyone helpme on what else I need to do.

Once I get this working I am going to modify the script so that the contents
of the CSV file are loaded into mysql for viewing


With thanks




Richard Bryce





<?php
$row = 1;
$handle = fopen ("test.csv","r");
while ($data = fgetcsv ($handle, 1000, ",")) {
$num = count ($data);
print "<p> $num fields in line $row: <br>\n";
$row++;
for ($c=0; $c < $num; $c++) {
print $data[$c] . "<br>\n";
}
}
fclose ($handle);
?>





Trisiana Tana
Posted: 05/08/2003, 2:35 AM

you should check your URL address:
should be complete like this:
http://servername/test1.php

"Richard Bryce" <richard@northshoreit.com.au> wrote in message
news:b7iare$ss0$1@news.codecharge.com...
> Hi All,
> A pretty basic PHP question....
>
> I pulled the following code down off www.php.net. When I put this into a
> file (named test1.php) and try to run it I am getting some CGI error.
Can
> anyone helpme on what else I need to do.
>
> Once I get this working I am going to modify the script so that the
contents
> of the CSV file are loaded into mysql for viewing
>
>
> With thanks
>
>
>
>
> Richard Bryce
>
>
>
>
>
> <?php
> $row = 1;
> $handle = fopen ("test.csv","r");
> while ($data = fgetcsv ($handle, 1000, ",")) {
> $num = count ($data);
> print "<p> $num fields in line $row: <br>\n";
> $row++;
> for ($c=0; $c < $num; $c++) {
> print $data[$c] . "<br>\n";
> }
> }
> fclose ($handle);
> ?>
>
>
>
>
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.