Invalid Stream Source

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
Steveo31
Forum Contributor
Posts: 416
Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA

Invalid Stream Source

Post by Steveo31 »

This seemed more like a PHP error than an XML one, so here it goes.

I am reading up on how to get data from XML into PHP. The URL I got the info from is here.

Anyway, I do the stuff exactly as they say, and this is the error that returns:


Warning: feof(): supplied argument is not a valid stream resource in c:\program files\easyphp1-7\www\xml\bookreader.php on line 17

Line 17 and thereabouts is:

Code: Select all

<?php

  $fp = fopen("books.xml", "r");
  $doc = fread($fp,100000);
  xml_parse($parser, $doc, feof($doc));

?>
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

do you have a function called feop()?
Steveo31
Forum Contributor
Posts: 416
Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA

Post by Steveo31 »

No... why?
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

LiLpunkSkateR wrote:do you have a function called feop()?
... where did feop come from??
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

hmm... i dunno if it'll work, but try feof($fp)... $fp instead of $doc
Steveo31
Forum Contributor
Posts: 416
Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA

Post by Steveo31 »

Heck... I dunno. Nothin's workin. Oh well.
Post Reply