Computing.Net > Forums > Web Development > PHP geturl error

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

PHP geturl error

Reply to Message Icon

Name: Instant8
Date: September 9, 2008 at 16:14:41 Pacific
OS: Windows XP
CPU/Ram: Intel Pentium 4 - 512 RAM
Product: Dell Dimension DIM5100
Comment:

Hello,

I have a sub-domain on a free hosting site.
It is a team site for another browser based
game I play (written in perl if that
matters). I have recently learned PHP and
decided to write a script to take info from
my team page and put it on my site. However
when I do so, I get an error message
stating:

Warning: file_get_contents() [function.file-
get-contents]: URL file-access is disabled
in the server configuration in
/home/www/mbbombers.awardspace.com/testing.p
hp on line 2

Is this a problem on the hosting site
(awardspace) or on the game I play?

Here is my PHP script:

<?
if ($source =
file_get_contents("http://goallineblitz.com/
game/team.pl?team_id=4819")) {
$search = "Cash";
$newText = substr($source,strpos($source,
$search)+strlen($search), 16);
echo $newText;
} else {
echo "Error : Could not retrive data, please
contact administrator";
}

?>




Sponsored Link
Ads by Google

Response Number 1
Name: Instant8
Date: September 9, 2008 at 16:24:50 Pacific
Reply:

Edit: Here is my new debbuged code:

<?
if ($source =
file_get_contents("http://goallineblitz.com/g
ame/team.pl?team_id=4819")) {
$search = "Cash";
$newText = substr($source,strpos($source,
$search)+strlen($search), 16);
echo $newText;
} else {
echo "Error : Could not retrive data, please
contact administrator";}

?>

However still expirecing the oringnal
problem:
Warning: file_get_contents() [function.file-
get-contents]: URL file-access is disabled in
the server configuration in
/home/www/mbbombers.awardspace.com/testing.ph
p on line 2

Warning:
file_get_contents(http://goallineblitz.com/ga
me/team.pl?team_id=4819) [function.file-get-
contents]: failed to open stream: no suitable
wrapper could be found in
/home/www/mbbombers.awardspace.com/testing.ph
p on line 2

I am a newbie at PHP, any help would be
appricated. If this is at my games server
side, is there any alternatives in getting
this information?


0

Response Number 2
Name: Michael J (by mjdamato)
Date: September 9, 2008 at 21:24:06 Pacific
Reply:

The error is pretty self explanatiory:

"URL file-access is disabled in the server configuration"

You get what you pay for. No alternatives that come to mind other than getting a real host.

Michael J


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: PHP geturl error

Simple PHP script error www.computing.net/answers/webdevel/simple-php-script-error/137.html

suppress PHP, mysql warnings www.computing.net/answers/webdevel/suppress-php-mysql-warnings/1221.html

Cannot connect to MySQL DB with PHP www.computing.net/answers/webdevel/cannot-connect-to-mysql-db-with-php/4085.html