Page 1 of 1

sscanf and fscanf

Posted: Wed Sep 03, 2003 12:30 pm
by joesmoh
Hey,

I am having trouble using the fscanf. First, I am trying to take a bunch of webpages and take specific data such as the title, email address, author, and texts and put it into a database. If anyone has any better way to do this, please tell.

So, I have this sscanf which returns title into $first and 1 for $somevalue
$somevalue = sscanf("<CENTER><B><FONT SIZE=+3>
title
</FONT></B></CENTER>",
"<CENTER><B><FONT SIZE=+3>
%s
</FONT></B></CENTER>", &$first)";

Now, I put that header into file.htm and run it through fscanf:

$openedfile = fopen("file.htm", r);
$somevalue = fscanf($openedfile,
"<CENTER><B><FONT SIZE=+3>
%s
</FONT></B></CENTER>", &$first)";
oddly, this returns nothing in $first and fscanf returns -1

Posted: Mon Sep 15, 2003 4:06 pm
by joesmoh
hmmm...
well anyone know a better way than fscanf then?

:-)