Click to See Complete Forum and Search --> : getting source code


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";
}
?>

themarty
09-05-2006, 11:25 AM
However, it does not work.

http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

sitehatchery
09-05-2006, 12:49 PM
http://www.webdeveloper.com/forum/showthread.php?t=119119&highlight=html+source