
March 19th, 2003, 11:10 AM
|
 |
PHP Member
|
|
Join Date: Jun 2002
Location: England
Posts: 163
Time spent in forums: 11 h 24 m 39 sec
Reputation Power: 6
|
|
|
reading a web page into a variable
Ok, I am still very new to flash and don't have meny good resource sites or books.
What i wanting to do is read a webpage into a variable, so this variable will contain the HTML content of the page.
Then i intend on doing some string manipulation etc......
I know the PHP equivelant is this:
PHP Code:
$fp = fsockopen ("www.google.com", 80, $errno, $errstr, 30);
if (!$fp)
{
echo "$errstr ($errno)
}
else
{
fputs ($fp, "GET / HTTP/1.0rnHost:andyrnrn");
$temp = fgets($fp, 1000);
while ($temp != "rn")
{
$headers .= $temp;
$temp = fgets($fp, 1000);
}
while (!feof($fp))
{
$temp = fgets ($fp,128);
$content .= $temp;
}
fclose ($fp);
}
print $content;
note that you can specifiy the port no.
any help would be cool.
Thanks

Last edited by andywhitt : March 20th, 2003 at 05:41 AM.
|