fopen and http ???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Baltis
Forum Newbie
Posts: 2
Joined: Fri Oct 04, 2002 9:00 pm

fopen and http ???

Post 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
mazzi
Forum Newbie
Posts: 2
Joined: Fri Oct 04, 2002 9:17 pm

Post by mazzi »

After you have set the file pointer, what do you read it with. Could you include the code you are using?
Baltis
Forum Newbie
Posts: 2
Joined: Fri Oct 04, 2002 9:00 pm

Post 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);

?>
Post Reply