Both possible answers could be true. file_get_contents() in its most basic form will only open a local file on the server. This same function supports what are called “stream wrappers”, which allow PHP to access a remote file as if it was a local file. This feature can be disabled on the server at the hosting provider’s whim. I have encountered both setups in the past, and once moved server to get them working because there was no other way to make the application work.
There’s another approach you can take, which is to use cURL to access these files. Here’s a function which can replace file_get_contents() pretty much directly:
function get_remote_form($strUri){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $strUri);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER,
array('Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
Paste that into your script near the top (so it appears in the script before any call to file_get_contents) and then locate and replace any instance of ‘file_get_contents’ with ‘get_remote_form’. Now if that works, you should be done. If it doesn’t, then that could be a sign that NetSol does not support cURL extensions in PHP. And if that’s the case, I don’t know what you should do except maybe vote with your feet. I like NetSol a lot for registering domains and a few other things, but I don’t have a lot of love for their PHP hosting.
Walter
On Jan 18, 2012, at 11:46 AM, Marcus Do Carmo wrote:
I bought this very nice script and installed it on the website I am working on., but after a while I realized that the google maps wasn’t showing the addresses of the properties but just ocean instead and wrote to the phpjabbers support team.
Their answer:
The problem is that your server doesn’t allow execution of file_get_contents() function. This function is used to load the map coordinates.Please contact your hosting provider regarding this issue. You can show them the link below:
http://sunshinedoorsspecialists.com/miamiuniqueproperties/script/file_get_contents.php
After speaking with Network Solutions they came to me with a “solution” I didn’t expect and said it could be fixed adding another script and for this they would need a level 2 technical support and therefore I have to pay a one time fee of $59.00.
My questions are: isn’t it something that was already supposed to work on my server or they are right? Is this something I could do myself to fix?
Here’s the website address:http://sunshinedoorsspecialists.com/miamiuniqueproperties/my-listings.html
(click on map to se the problem)
Many thanks again
Marcus
On 11 Feb 2011, 12:27 am, Helveticus wrote:
Here’s one that will need one line of code in your FW page.
Your client can update the listing via the admin interface.
Property Listing Script | PHP Real Estate Script | PHPJabbers
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options