Page 1 of 1

Include a external http://url?var=val into a php page

Posted: Fri Jan 23, 2009 9:45 pm
by pchang
How can I include this

http://74.125.19.101/translate_c?hl=en& ... eFwoSerr6Q

in a secure way without having to have the allow_url_fopen = on in the php.ini file so I can avoid cross-site-scripting (xss) attacks.
Currently I have the allow_url_fopen = off and I get this error message

Warning: require_once() [function.require-once]: URL file-access is disabled in the server configuration in /home/channcom/public_html/changdesign.com/cnn.php on line 10

Warning: require_once(http://74.125.19.101/translate_c?hl=en& ... FnxkVB23LA) [function.require-once]: failed to open stream: no suitable wrapper could be found in /home/channcom/public_html/changdesign.com/cnn.php on line 10

Fatal error: require_once() [function.require]: Failed opening required 'http://74.125.19.101/translate_c?hl=en& ... FnxkVB23LA' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/channcom/public_html/changdesign.com/cnn.php on line 10

I look around everywhere but have not found anything :banghead:

link http://www1.changdesign.com/cnn.php

code I use so far

<?php require_once('http://74.125.19.101/translate_c?hl=en& ... FnxkVB23LA'); ?>


before hand thank you for your help

Re: Include a external http://url?var=val into a php page

Posted: Fri Jan 23, 2009 10:07 pm
by requinix
That page sure doesn't look like a PHP page. So why are you trying to use a function that's meant exclusively for including PHP pages?

I'm pretty sure this will work better than what you're trying.

Re: Include a external http://url?var=val into a php page

Posted: Sat Jan 24, 2009 12:35 pm
by pchang
Any suggestions on how I should write the code?

Re: Include a external http://url?var=val into a php page

Posted: Sat Jan 24, 2009 4:00 pm
by requinix
Not really. The function is pretty self-explanatory.