Page 1 of 1

fopen and http ???

Posted: Fri Oct 04, 2002 9:00 pm
by Baltis
Hello,

I have written a script which picks out a file and put the data into a 2-dimensionally array. This works as long as the file, which should be picked out lies on the computer where also the script is being prepared. As soon as an internet or LAN connection is being used the contents will be reduced to a few lines. After a lot of tests I assume that this is because of the sendings of the packages.

Please, can somebody give me an idea, how I can repair this? I would be very thankful for every small reference.

Baltis

Posted: Fri Oct 04, 2002 9:17 pm
by mazzi
After you have set the file pointer, what do you read it with. Could you include the code you are using?

Posted: Sat Oct 05, 2002 4:03 am
by Baltis
that's the code:

<?
$fd = fopen ("http://xxxxxxx:xxxx/hp/acc.txt", "r");

$users = array();

while ($data = fgetcsv ($fd, 1000, ","))
{

$num = count ($data);
$user = array();
for ($c=0; $c < $num; $c++)
{
array_push($user, $data[$c]);
}
array_push($users, $user);
}

var_dump($users);

fclose($fd);

?>