I'm a newbie trying to write a script that will get html from an external site (the bit i'm having trouble with) and then encrypt it and display it on screen. I've got a very good encryption script but can't seem to get the external html. This is as far as i've got for getting the html:
<?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.example.com/');
// 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";
}
?>
However for some reason it doesn't work. Any suggestions?