sending FTP packets in PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • yawnmoth

    sending FTP packets in PHP

    so... i'm trying to send some FTP packets, via PHP, and... i'm not
    really sure how to construct 'em. HTTP 1.0 packets have the following
    structure:

    GET http://whatever.com/ HTTP/1.0
    Accept: */*
    Referer: http://whateveryouwantagain.com/

    etc

    to send these packets, one would have to use fsocketopen, using port
    80, and then fputs.

    but what structure do FTP packets have? they'd probably have to have
    a place for the password / username, but what else? also, is there,
    perhapes, some PHP function that would make this easier? thanks! :)
  • Nikolai Chuvakhin

    #2
    Re: sending FTP packets in PHP

    terra1024@yahoo .com (yawnmoth) wrote in message
    news:<a0d63404. 0312141818.47a5 3861@posting.go ogle.com>...[color=blue]
    >
    > i'm trying to send some FTP packets, via PHP, and... i'm not
    > really sure how to construct 'em.[/color]

    First of all, it is not necessary; PHP has a set of FTP functions:


    [color=blue]
    > one would have to use fsocketopen, using port 80, and then fputs.[/color]

    Hmm... Actually, default FTP port is 21...
    [color=blue]
    > but what structure do FTP packets have?[/color]

    If you are really curious, read RFC 959:



    Cheers,
    NC

    Comment

    Working...