Thread: php and ftp

  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Rep Power

    php and ftp

    I'm writing a what should be a simple ftp script for users to upload a gif or jpg image.

    this is what I have :
    PHP Code:

    $ftp_user "username";
    $ftp_pass "password";
    $ftp_path "web/files/banners/";

    $function) {


    $function == "upload") {

    _ftpConnect() {
    $ftp_conn ftp_connect($ftp_link);

    $r _ftpConnect();

    $upload ftp_put($r$upfile_name$fileFTP_BINARY);
    $upload) {
      } else {

    My problem is that I get this error : Warning: Unable to find ftpbuf 0

    I have no idea what is means and it occurs on the lines with ftp commands accept for ftp_connect.

    If someone could tell me what I'm doing wrong or what the error means I would be most grateful
    We are what we repeatedly do, Excellence then is not something we do but a Habit.
  2. #2
  3. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Caro, Michigan
    Rep Power
    Why do you have your function declaration inside of a conditional? Just define it and call it if you need it.

    Where is $function defined? If it's not, then your function is never defined...

    Also, if you're going to use outside variables in your function, then you have to make them global.

    function whatever()
    global $this;
    global $that;



    etc... May be other things wrong, too, that's the first I noticed. i doubt you are even making a connection, you should check for that first.

    ---John Holmes...
    -- Cigars, whiskey and wild, wild women. --

IMN logo majestic logo threadwatch logo seochat tools logo