[Typo3-dev] get HTML of a page...

Christian Trabold trabold at mehrwert.de
Fri May 13 17:11:38 CEST 2005


Hello!

> I already asked this on typo3-user but no answer... (I couldn't find the 
> class/code )
> 
> I currently use this code to get the HTML of a page with a specific UID:
>    function getPageHTML($uid) {
>        $command = '/usr/bin/wget -O - 
> "http://ns2.latinsecure.com:8042/index.php?id='.((int)$uid).'&ebook=1"';
>        $handle = popen($command, 'r');
>        $html = '';
>        while (!feof($handle)) {
>            $html .= fread($handle, 10240);
>        }
>        fclose($handle);
>        return $html;
>    }
> 
> But I am wondering of there isn't any specific typo3 function so I can 
> bypass
> our webserver and get direct access to the rendered HTML.
> 
> I do this in the backend but willing to switch the FE if there isn't any 
> BE code/class
> that can handle it..

Have a look at t3lib_div::getURL($url). Maybe that is what you're 
looking for.


Regards,

Christian




More information about the TYPO3-dev mailing list