Re: curl equivalent in PHP

From: Date: Fri, 02 Mar 2012 16:07:13 +0000
Subject: Re: curl equivalent in PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-316841@lists.php.net to get a copy of this message
On 03/02/2012 06:26 AM, Nibin V M wrote:
Hello, I am trying to display the website content through a php code ( my own websites; doesn't cause copy right issues ). I use curl to display the page via the following simple code. <?php $curl = curl_init(); curl_setopt ($curl, CURLOPT_URL, "http://mytest.com"); curl_exec ($curl); curl_close ($curl); ?> But on some of my servers, curl isn't enabled! Is there any equivalent code to achieve the same? Thank you,
As long as you do not need to perform posts to the other website via the PHP request, you could include, file_get_contents, fopen + fread, etc... All you need to make sure is that allow_url_fopen is enabled. -- Jim Lucas http://www.cmsws.com/ http://www.cmsws.com/examples/ http://www.bendsource.com/

« previous php.general (#316841) next »