RE: [PHP] Url's content displayed in phtml pages.
| From: | Jesper Vad Kristensen | Date: | Wed, 26 Jul 2000 12:44:48 +0000 |
| Subject: | RE: [PHP] Url's content displayed in phtml pages. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-8285@lists.php.net to get a copy of this message | ||
Hi krishna kanth,
> ex:- if i want to have my friends homepage in my one part of
> my screen which
> has got a url but not coded in phtml, how will i be able to do that.
Check out the code snippet below. The idead is that you "open the url like a
file". That will get you a fully parsed version of the homepage. Then, as
you can see in my example, you might have to rip the page apart and just use
the stuff you want.
Sincerely,
Jesper
###########################################################
<?php
function parsefile($file) {
$arraytop = split("<!-- CONTENT {START} -->",$file);
$file = $arraytop[1];
$arraybottom = split("<!-- CONTENT {END} -->",$file);
$file = $arraybottom[0];
return $file;
}
if (!($wholesite = fopen("http://www.rejsefeber.dk/flight/index.html","r")))
{
print ("<html><head></head><body>");
print ("<p>File could not be opened. Server may be down.");
print ("</body></html>");
exit;
}
print ("<html><head></head><body>");
echo "<h1>Rejsefeber - ripppet fra deres side</h1>";
while (!feof($wholesite)) {
$file .= fgets($wholesite,255);
}
# debug echo $alltext;
parsefile (&$file);
echo "\n $file \n";
fclose($wholesite);
print ("</body></html>");
?>