patimages
09-05-2006, 04:36 AM
Hi,
In the following script, I am trying to retrieve the source code of a site after sumbitting a query. However, it does not work. I figure the target page (http://www.mysite.com/query) does not have time to load (in other words to process my query) so I can retrieve it.
Do you have any idea how to solve this ???
thanks a lot !!!!!!!!!!!
Patrick
[php]
<?php
// Get a file into an array. In this example we'll go through HTTP to get
// the HTML source of a URL.
$lines = file("http://www.mysite.com/".$_GET['query']); //$lines is an array();
// Loop through our array, show HTML source as HTML source; and line numbers too.
foreach ($lines as $line_num => $line) {
echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
}
?>
In the following script, I am trying to retrieve the source code of a site after sumbitting a query. However, it does not work. I figure the target page (http://www.mysite.com/query) does not have time to load (in other words to process my query) so I can retrieve it.
Do you have any idea how to solve this ???
thanks a lot !!!!!!!!!!!
Patrick
[php]
<?php
// Get a file into an array. In this example we'll go through HTTP to get
// the HTML source of a URL.
$lines = file("http://www.mysite.com/".$_GET['query']); //$lines is an array();
// Loop through our array, show HTML source as HTML source; and line numbers too.
foreach ($lines as $line_num => $line) {
echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
}
?>