|
Posted by Richard Walker on 06/12/06 09:59
pieter_hordijk@hotmail.com wrote:
> can you post your code plz...
>
> Richard Walker schreef:
>
>> Hi
>>
>> Using php 4.3.8 with ftp enabled (shows as such in phpinfo) but still
>> can't use ftp functions eg ftp_connect(<server>) gives Call to Undefined
>> Function. I've Googled til I'm google eyed but although I can find lots
>> of references to this, can't seem to find an answer. Please will someone
>> help?
>>
>> TIA
>> --
>> Richard
>
I've done some more testing. The code runs OK in a browser from an html
form, but I want to run it as part of a prog run from a cron job, so
just as a script. Why doesn't this work?
#!/usr/local/bin/php -q
<?php
$conn=ftp_connect("slaughdensailingclub.co.uk")or die("no conn");
ftp_login($conn,"username","password") or die("no login");
$upload=ftp_put($conn,"remote_filename","local_filename",FTP_BINARY);
if (!$upload) echo "no upload";
else echo "upload ok";
?>
--
Richard
Navigation:
[Reply to this message]
|