[thelist] [PHP] Hitting a URL from within a function, but NOT directing the browser there...

kasimir-k kasimir.k.lists at gmail.com
Mon Mar 12 17:27:46 CDT 2007



>>> $f = file($hitURL);
>> Not bad, but often file_get_contents is better 

Max Schwanekamp scribeva in 12/03/2007 17:36:
> FWIW, if the allow_url_fopen php.ini setting is set to false, you might 
> use cURL instead (if libcurl is installed, of course).  This has the 
> added benefit of some added flexibility in structuring the request. 

And one good option could be Zend Framework's HTTP Client. Haven't tried 
it myself yet, but recently tried the PDF module, and it worked like a 
charm allowing me easily watermark pages of pdf documents on the fly. 
Actually, worth tipping:

<tip type="PHP author="kasimir-k">

Zend Framework is extremly handy even if you don't build your 
applications the MVC-way. Many of its modules can be easily used with 
any app, with minimal configuration. For example the PDF module makes it 
easy to create and manipulate PDF-documents, and HTTP Client has great 
flexibility while being easy to use - and both can be used without any 
other libraries (PHP5 required).

http://framework.zend.com/
http://framework.zend.com/manual/en/zend.pdf.html
http://framework.zend.com/manual/en/zend.http.html

</tip>


.k



More information about the thelist mailing list