Forum Moderators: coopster

Message Too Old, No Replies

PHP View Source?

         

sidyadav

1:04 pm on May 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there any kind of a function which lets me view the full html-source of the page I specify?

ie. <? widgets_source("ht*p://www.example.com");?>

Any pointers would be most appreciated,
Sid

thedagda

2:23 pm on May 28, 2004 (gmt 0)

10+ Year Member



try the show_source() function.

[php.net...]

unit

1:22 pm on May 29, 2004 (gmt 0)



If you wanted the entire contents of a url in one string, you could use something like this:

function widgets_source($url) {
if($fp = file($url)) {
return implode("", $fp);
} else {
return false;
}
}

sidyadav

3:56 pm on May 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks a lot guys, but I just found the solution:

<?
$html2 = implode('', file(ht*p://www.foo.com));
echo "$html2";
?>

It actually displays the whole page when viewing from a browser, but if you try inserting $html2 into a MySQL database, it will insert the html-source code.

Sid