SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: uploading

  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've created a guestbook and there's a field where people can upload images.

    I'm getting an error (bad or missing parameters on line 7)

    <?php
    $filename = $piclink_name;
    $conn = ftp_connect("blabla.myip.org");

    ftp_login($conn, "xxxx", "xxxx");
    ftp_chdir($conn, "c:/phpdev2/www/magnus/guestbook/bilder");
    ftp_put($conn, $piclink_name, $piclink, FTP_BINARY);
    ftp_quit($conn);

    what's wrong with that part? I've checked that all variables are matching the name in the form fields...

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm... it seems like the $piclink_name doesn't get any value. But I've checked and in the form I have
    <INPUT TYPE="FILE" NAME="piclink">

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's strange... The $piclink_name do get a value... but not $piclink... It's just showing (none) when trying to echo it.

  4. #4
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hmmm who configured PHP? Are you using your own server, or your host's?

    What does $piclink_size give you?
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  5. #5
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You remembered the enctype="multi-part/formdata" in the form tag right?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  6. #6
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Kevin: I'm using it at home at the moment.
    The $piclink_size returns nothing...

    Freddy: Yeah, I did that part

  7. #7
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Try setting the upload_tmp_dir setting in your php.ini file to a directory that exists on your system...
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  8. #8
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll post the full guestbook.php here a bit crappy design but it's a rough first outcast.


    <HTML>
    <HEAD>
    <TITLE>I have nothing left to say!</TITLE>
    </HEAD>
    <BODY BGCOLOR="" BACKGROUND="bg.gif" BGPROPERTIES="fixed" TEXT="purple"
    LINK="black" VLINK="blue" ALINK="blue">
    <CENTER>
    <FONT FACE="Verdana,Arial" SIZE="3">
    Say my name, *****!<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
    <TR>
    <TD WIDTH="10">&nbsp;</TD><TD WIDTH=426>
    <FONT FACE="Verdana, Arial" SIZE="1">

    <br><br>

    <TABLE CELLSPACING=1 CELLPADDING=1 BORDER=0> <!-- WIDTH="426" -->
    <FORM ACTION="guestbookprocess.php" METHOD="POST" enctype="multi-part/formdata">
    <TR>
    <TD ALIGN=left>
    <FONT FACE="Verdana,Arial" SIZE="1">
    Name<BR><INPUT NAME="name" TYPE=Text SIZE="30" MAXLENGTH="255">
    </FONT></TD>
    <TD ALIGN=left width=*>
    <FONT FACE="Verdana,Arial" SIZE="1">
    E-mail<BR><INPUT NAME="mail" TYPE=Text SIZE="30" MAXLENGTH="99">
    </FONT></TD></TR>
    <TR>
    <TD ALIGN=left><FONT FACE="Verdana,Arial" SIZE="1">
    Homepage (without http://)<BR>
    <INPUT NAME="homepage" TYPE=Text SIZE="30" MAXLENGTH="255">
    </FONT></TD>
    <TD ALIGN=left>
    <FONT FACE="Verdana,Arial" SIZE="1">
    Hometown<BR><INPUT NAME="town" TYPE=Text SIZE="30" MAXLENGTH="255">
    </FONT>
    </TD>
    </TR>
    <TR>
    <TD ALIGN=left><FONT FACE="Verdana,Arial" SIZE="1">
    Attractive or digusting?<BR>
    <INPUT NAME="free1" TYPE=Text SIZE="30" MAXLENGTH="255">
    </FONT>
    </TD>
    <TD ALIGN=left><FONT FACE="Verdana,Arial" SIZE="1">
    Fun or No fun at all?BR>
    <INPUT NAME="free2" TYPE=Text SIZE="30" MAXLENGTH="255">
    </FONT>
    </TD>
    </TR>

    <TR>
    <TD ALIGN=left><FONT FACE="Verdana,Arial" SIZE="1">
    A picture<BR>
    <INPUT TYPE=FILE NAME="piclink">
    </FONT>
    </TD>

    <TR> <TD ALIGN=left></TD> <TD ALIGN=left></TD> </TR>
    <TR> <TD ALIGN=left></TD> <TD ALIGN=left></TD> </TR>

    <TR><TD COLSPAN=2>

    <TABLE BORDER=0><TR><TD COLSPAN=2>
    <FONT FACE="Verdana,Arial" SIZE="1">
    Message<BR>
    <TEXTAREA NAME="textfield" ROWS=5 COLS=55 WRAP=Virtual>
    </TEXTAREA>
    </FONT>
    </TD>
    </TR>
    <TR>
    <TD>
    <INPUT NAME="submit" TYPE=Submit VALUE="Send message!">
    <INPUT TYPE=Reset VALUE="Rensa!">
    </TD>
    </TR>
    </TABLE>
    </TD></TR>
    </FORM>

    ( I left out the database queries, but they are of no importance her anyway)

  9. #9
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've already set the tmp dir to c:\temp

  10. #10
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I did a new page from scratch and it worked just fine.
    Don't know what the problem was.
    Thanks anyway guys
    /Magnus


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •