dcole.ath.cx Posted April 27, 2006 Share Posted April 27, 2006 Is there a way to get the scource of a webpage with a script? Like google has "snapshots" of pages... Link to comment Share on other sites More sharing options...
justsomeguy Posted April 27, 2006 Share Posted April 27, 2006 Not exactly sure what you're talking about, so yes and no.If you want to output the PHP source of your PHP script to the web:highlight_fileIf you want to save the HTML source code from some other web page:$html_source = file_get_contents("http://www.w3schools.com/index.php");file_get_contentsIf you want to save the PHP source code from some other web page:well.. no, you can't. Link to comment Share on other sites More sharing options...
dcole.ath.cx Posted April 27, 2006 Author Share Posted April 27, 2006 nvm, I was coming to say I got it...I was wanting the cache of pages for backup and other purposes...Like having an over flow server but only DHTML or the output of php...or having history for simple people I host, some new people write over there HTML with out thinking...any way I used: <?php$read = fopen("http://dcole.ath.cx/index.php", "r");while ($line = fgets ( $read , 999999 )) {print $line; }fclose($read);?>that was the basic test script... thanks for the help though Link to comment Share on other sites More sharing options...
justsomeguy Posted April 27, 2006 Share Posted April 27, 2006 Check out file_get_contents above, it will eliminate most of that code: <?phpprint file_get_contents("http://dcole.ath.cx/index.php");?> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now