Question : Help using php ftp_get

Hi All - I'm trying to use the following code to download some metar files from NOAA but I'm getting an error can not connect.  Not sure what I'm doing wrong or if I have to enable something in the php.ini file.  I'm using godaddy shared.

<?php
$source = "data/observations/metar/stations/CYQR.TXT";
$target = fopen("yqr-metar.txt", "w");

$conn = ftp_connect("tgftp.nws.noaa.gov") or die("Could not connect");
ftp_login($conn,"anonymous","myemailaddresshere");

ftp_fget($conn,$target,$source,FTP_ASCII);

ftp_close($conn);
?>

Answer : Help using php ftp_get

AFAIk godaddy does not allow outgoing connects. You have to use thei proxy for such things.

See http://www.bin-co.com/php/articles/curl_in_godaddy.php

You might use url with the proxy to getthe files, the ftp_ function AFAIK do not support a proxy.
Random Solutions  
 
programming4us programming4us