Hmm..I am a php newbie ( just started learning it )...
what my need is to display website from my server always for a
non-registered domain.This is the code I use now to display the website
$opts = array(
'header'=>"Accept-language: en\r\n" .
$context = stream_context_create($opts);
$fp = fopen('http://www.blahblah.com', 'r', false, $context);
Of course blahblah.com isn't registered yet. This will load the index page
of blahblah.com fine ( since I use hosts file to resolve blahblah.com on
the server ). But if we click on any link, it will give "server not found"
error since my "local machine" is trying to resolve blahblah.com this time.
I need to avoid it and want to load my domain "always" from the server when
I click any link on the webpage, etc .
How can I modify the above code to make it work! If possible, I request
somebody to tell me the exact code that I need to change in the above
script - since most of the php part is still greek to me :)
On Fri, Mar 2, 2012 at 10:09 PM, Micky Hulse <rgmi...@gmail.com> wrote:
> On Fri, Mar 2, 2012 at 8:07 AM, Jim Lucas <li...@cmsws.com> wrote:
> >> But on some of my servers, curl isn't enabled! Is there any equivalent
> >> code
> >> to achieve the same?
> I've used a combination of output buffering , readfile()  and
> caching (specific to the framework I was using).
> Simply, you could resort to:
> <?php readfile('http://www.google.com'); ?>
> Ofc, the links would need to be absolute in order for the assets to load.
> Good luck!
>  php.net/ob-start
>  php.net/readfile
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php