Page 1 of 1

Invalid Stream Source

Posted: Sat Mar 27, 2004 2:18 pm
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));

?>

Posted: Sat Mar 27, 2004 3:50 pm
by d3ad1ysp0rk
do you have a function called feop()?

Posted: Sat Mar 27, 2004 5:54 pm
by Steveo31
No... why?

Posted: Sat Mar 27, 2004 5:59 pm
by Illusionist
LiLpunkSkateR wrote:do you have a function called feop()?
... where did feop come from??

Posted: Sat Mar 27, 2004 6:04 pm
by Illusionist
hmm... i dunno if it'll work, but try feof($fp)... $fp instead of $doc

Posted: Sun Mar 28, 2004 8:58 am
by Steveo31
Heck... I dunno. Nothin's workin. Oh well.