By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,045 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

get remote file content

P: 5
there are some things on server which i can't change:
1. i can't add some extra things like CURL lib;
2. allow_url_fopen is disabled in php.ini, so i can't use nor fopen("remote_file", r), nor get_file_contents(remote_file)....
3. fsockopen can't connect to any server i thing it's disabled by php.ini config too

for example i can do this things in other environments, in i can do:

System.Net.WebClient c = new System.Net.WebClient();
c.BaseAddress = "http://remote-server/";

in jsp:

URL url = new URL("http://remote-server/");
HttpURLConnection c = (HttpURLConnection)url.openConnection();
InputStream in = c.getInputStream();
String html = stringFromInputStream(in);

i can't believe that there is no such similar wayt in php.... but google didn't help me to find any solutions expect fopen, get_file_content or fsockopen....
Jan 8 '08 #1
Share this Question
Share on Google+
1 Reply

P: 93
The cURL module lets you do all of that kind of stuff very easily. And fsockopen allows you to connect to other websites. I think that the problem lies with your webhost rather than with php.
Jan 8 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.