PHP Error

This is a discussion on PHP Error within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hello, We have just got a problem on our hands and no idea what has happened. When you view the ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2006
Hugh Janus
 
Posts: n/a
Default PHP Error

Hello, We have just got a problem on our hands and no idea what has
happened.
When you view the page it says:

Warning: file(): URL file-access is disabled in the server configuration in
/home/jaxair/public_html/adam/ivaoau/AU Online Flights/auflights.php on line
31

Warning: file(http://de.www.ivao.aero/whazzup.txt): failed to open stream:
no suitable wrapper could be found in
/home/jaxair/public_html/adam/ivaoau/AU Online Flights/auflights.php on line
31
Outbound Flights

Warning: Invalid argument supplied for foreach() in
/home/jaxair/public_html/adam/ivaoau/AU Online Flights/auflights.php on line
39

This has only just come about and was working fine before

Here is the code for the file

<?

print("<tr>");
$file=file("http://de.www.ivao.aero/whazzup.txt");
print("<b>Outbound Flights</b><p>");
$outfound="0";
$a=0;
foreach($file as $line) {
list($callsign, $vid, $realname, $clienttype, $frequency, $latitude,
$longitude, $altitude, $groundspeed, $planned_aircraft, $planned_tascruise,
$planned_depairport, $planned_altitude, $planned_destairport, $server,
$protrevision, $rating, $transponder, $facilitytype, $visualrange,
$planned_revision, $planned_flighttype, $planned_deptime,
$planned_actdeptime, $planned_hrsenroute, $planned_minenroute,
$planned_hrsfuel, $planned_minfuel, $planned_altairport, $planned_remarks,
$planned_route, $planned_depairport_lat, $planned_depairport_lon,
$planned_destairport_lat, $planned_destairport_lon, $atis_message,
$time_last_atis_received, $time_connected, $client_software_name,
$client_software_version, $adminrating)=split(":",$line);
if(eregi("^Y",$planned_depairport)) {
if($clienttype=="PILOT") {
$name=preg_replace("/([[:space:]A-Z]{4}$)/","",$realname);
print("<td align=left valign=top width=300 background=bg.jpg><b>Flight:</b>
$callsign<br><b>Pilot:</b> <font color=darkblue><b><a
href=http://www.ivao.aero/members/person/details.asp?ID=$vid
style=text-decoration:none
target=_blank>$name</font></a></b><br><b>$planned_depairport</b> to
<b>$planned_destairport</b><br><img src='http://status.ivao.aero/$vid.png'
></td>");


$outfound=1;
$a++;
$x++;
if($a%3==0) {
print("</tr><tr>");
$x=0;

}

}

}

}

if($outfound!="1") {

print("<em>No outbound flights currently found for Australia</em>");

}

print("</tr>");

?>

Any help appriciated


Reply With Quote
  #2 (permalink)  
Old 04-08-2006
David Haynes
 
Posts: n/a
Default Re: PHP Error

Hugh Janus wrote:
> Hello, We have just got a problem on our hands and no idea what has
> happened.
> When you view the page it says:
>
> Warning: file(): URL file-access is disabled in the server configuration in
> /home/jaxair/public_html/adam/ivaoau/AU Online Flights/auflights.php on line
> 31
>
> Warning: file(http://de.www.ivao.aero/whazzup.txt): failed to open stream:
> no suitable wrapper could be found in
> /home/jaxair/public_html/adam/ivaoau/AU Online Flights/auflights.php on line
> 31
> Outbound Flights
>
> Warning: Invalid argument supplied for foreach() in
> /home/jaxair/public_html/adam/ivaoau/AU Online Flights/auflights.php on line
> 39
>
> This has only just come about and was working fine before
>
> Here is the code for the file
>
> <?
>
> print("<tr>");
> $file=file("http://de.www.ivao.aero/whazzup.txt");
> print("<b>Outbound Flights</b><p>");
> $outfound="0";
> $a=0;
> foreach($file as $line) {
> list($callsign, $vid, $realname, $clienttype, $frequency, $latitude,
> $longitude, $altitude, $groundspeed, $planned_aircraft, $planned_tascruise,
> $planned_depairport, $planned_altitude, $planned_destairport, $server,
> $protrevision, $rating, $transponder, $facilitytype, $visualrange,
> $planned_revision, $planned_flighttype, $planned_deptime,
> $planned_actdeptime, $planned_hrsenroute, $planned_minenroute,
> $planned_hrsfuel, $planned_minfuel, $planned_altairport, $planned_remarks,
> $planned_route, $planned_depairport_lat, $planned_depairport_lon,
> $planned_destairport_lat, $planned_destairport_lon, $atis_message,
> $time_last_atis_received, $time_connected, $client_software_name,
> $client_software_version, $adminrating)=split(":",$line);
> if(eregi("^Y",$planned_depairport)) {
> if($clienttype=="PILOT") {
> $name=preg_replace("/([[:space:]A-Z]{4}$)/","",$realname);
> print("<td align=left valign=top width=300 background=bg.jpg><b>Flight:</b>
> $callsign<br><b>Pilot:</b> <font color=darkblue><b><a
> href=http://www.ivao.aero/members/person/details.asp?ID=$vid
> style=text-decoration:none
> target=_blank>$name</font></a></b><br><b>$planned_depairport</b> to
> <b>$planned_destairport</b><br><img src='http://status.ivao.aero/$vid.png'
> ></td>");

>
> $outfound=1;
> $a++;
> $x++;
> if($a%3==0) {
> print("</tr><tr>");
> $x=0;
>
> }
>
> }
>
> }
>
> }
>
> if($outfound!="1") {
>
> print("<em>No outbound flights currently found for Australia</em>");
>
> }
>
> print("</tr>");
>
> ?>
>
> Any help appriciated
>
>

Most likely your service provider has disallowed fopen on URL files in
the php.ini file.

The relevant lines are:
;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On

If this is so, you can either get your provider to set allow_url_fopen
to On, or recode using fsockopen.

-david-

Reply With Quote
  #3 (permalink)  
Old 04-08-2006
Hugh Janus
 
Posts: n/a
Default Re: PHP Error

Thanks for that, that was the problem, got on to the hosters and they
enabled it right away.

Cheers !!!


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:20 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0