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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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- |