Hi
I need to use the file() function to read information from a remote url. file() is however not allowed on that particular server. The Hosting company is quite willing allow it for my website but doesn't want to enable it server wide. What options are available? Are there add-ons , alternatives to file(), a .htaccess trick etc etc?
Server: Apache/1.3.41 (Unix) mod_ssl/2.8.31 OpenSSL/0.9.8g PHP/4.3.1 mod_throttle/3.1.2 mod_gzip/1.3.26.1a
Thanks
Allowing file() for just one website on a shared server
Moderator: General Moderators
Re: Allowing file() for just one website on a shared server
Hi Jsh
In fact the service provider is moving us to a PHP5 server where file() is allowed (Because security has been improved in php5?). But can I do the same things with fread()?
In fact the service provider is moving us to a PHP5 server where file() is allowed (Because security has been improved in php5?). But can I do the same things with fread()?
Re: Allowing file() for just one website on a shared server
file() is just an easy way to pull each line from a file & put it in an array. You can duplicate that with fopen(), fread(), fclose() and some fancy logic, but if file() is available, definitely use it.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: Allowing file() for just one website on a shared server
If you don't need to read the whole file, using fread and explode() would be better to create the array, or if file() isn't available you seem to have no other choice