1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[PHP] Need help with script (paid)

Discussion in 'Hire a Freelancer' started by jazzc, Jun 30, 2009.

  1. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,468
    Likes Received:
    10,148
    Hi all,

    I am writing a script to post to CL in PHP.

    Now, I have a problem performing the post with CURL. I cannot make the form submit correctly.
    So, I am willing to move some $$ to the first person that can make me a working example. No fancy staff, no features but just the submition part.
    Here 's the details
    The script logs in and gets the cookie. It then goes to (example)
    Code:
    https://post.craigslist.org/roa/S/wan/none/x
    , fetches all the input fields, fills them with junk and tries to submit.
    I get the dreaded "Received problem 2 in the chunky parser" in Curl So I am doing something wrong.
    Here are my headers:
    Code:
    POST /roa/S/wan/none/x/mjwt5LUaqo11JeG0/ciqV6 HTTP/1.1 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) Host: post.craigslist.org Referer: https://post.craigslist.org/roa/S/wan/ Cookie: cl_login_cookie=xmsn4omfooBGazXTb3g6YPcqVz4Ze9u9Q0clASlXBBcqhUxtL3GdvOLHk7ZHXtyV; cl_privilege_cookie=edHj2yJPadfKWnAlzhwxpP5WZxswnTaEbzRYbFFyGsP3J7AFSgzluqtgdfZjMQjq; cl_scrck=U2FsdGVkX18yNDcwMzI0N8AiBwCWqK9Iii7xrbpcnVHaTYCieudiIlt9yL0czdt2ijfB4iSnWw0; Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 Accept-Language: en,el-GR;q=0.9,el;q=0.8 Accept-Charset: utf-8, utf-16, *;q=0.1 Pragma: no-cache Cache-Control: no-cache Connection: Keep-Alive, TE TE: deflate, gzip, chunked, identity, trailers Content-Length: 1477 Content-Type: multipart/form-data; boundary=----------dQD6HRmfxrxw49A4m8uERh Expect: 100-continue
    
    And here 's the CORRECT headers I got from Fiddler when I submit through the Opera browser.

    Code:
    POST /roa/S/wan/none/x/SUvjkFNX7Ox53xu9/OCcOh HTTP/1.1
    User-Agent: Opera/9.80 (Windows NT 6.0; U; en) Presto/2.2.15 Version/10.00
    Host: post.craigslist.org
    Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
    Accept-Language: el-GR,el;q=0.9,en;q=0.8
    Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1
    Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0
    Cookie: cl_login_cookie=pPe09QOfE6BHzJ74F1QsNC2vgRzat0fPHnlByXTw2J9OoY4yDb7hrM7bsEV0t2yk; cl_def_lang=en; cl_def_hp=sandiego; cl_scrck=U2FsdGVkX183MTQyNzE0MtWJMh9AMYbqo_QduvfPVBectQ-LK2Qr1BGrlRyDNROy-Lu4evbPWO0
    Cookie2: $Version=1
    Connection: Keep-Alive, TE
    TE: deflate, gzip, chunked, identity, trailers
    Content-Length: 2769
    Content-Type: multipart/form-data; boundary=----------dQD6HRmfxrxw49A4m8uERh
    
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="postingKey"
    
    SUvjkFNX7Ox53xu9
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="test"
    
    OCcOh
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="U2FsdGVkX.183MTQyN:zE0MrhLOmUpqd3eL60xF19RmCzgs.XkMel5uouI-FnsR6LV0MQXrAwjIYAc"
    
    demo
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="U2FsdGVkX183MTQyNz:E0MmzCsvWniexbzefYS2M.EgNq7gj:A:ChbO9Ug"
    
    1
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="U2FsdGVkX1.83MTQyNzE0MgO7JImRbH7:sehcm.TqM2j.myOIUUZk8KD4A1mSPtghVxQa4iiy0zewJY"
    
    11
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="U2FsdGVkX183MTQyNzE0MmmuIJgGIu2mcNuasDm19ghQU6bL_9qi8qqdEitEQ_3F"
    
    something@gmail.com
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="U2FsdGVkX183MTQyNzE0MiDJurEL5R3MqyRqtqldkWMO6r4WSng1mWnKrdsLlXBv"
    
    C
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="U2FsdGVkX183MTQyNzE0Mu-m2scEHi44PSRcp77KH3Ezz49IaB_Z89kFyYE08lt3PbA8JhDDMvk"
    
    U2FsdGVkX183MTQyNzE0MvCYST-W4nASMwlt1CSfwR9wk0kEQRr6EDBqxe_cKs1tJZRn4gtwcqM
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="U2FsdGVkX183MTQ.yNzE0MuvRtnZjnOoER2Wrx0WjFPZP-1vTNLkdq7zW:_LB_ujWFK3nLoHwhLSM"
    
    U2FsdGVkX183MTQyNzE0MmWorycRBYg5ba_juOUQ-y3Ociu-J8LrSHR8potuzeuc
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="U2FsdGVkX183MTQyNzE0MtBwYuxmp6mwk.H3N3KFHGrd6dDDwB7YwlaBh78hB2fZC"
    
    ds
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="image1"
    
    add
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="imgfile1"; filename=""
    
    
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="image2"
    
    add
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="imgfile2"; filename=""
    
    
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="image3"
    
    add
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="imgfile3"; filename=""
    
    
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="image4"
    
    add
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="imgfile4"; filename=""
    
    
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="U2FsdGVkX183MTQyNzE0Mu-m2scEHi44PSRcp77KH3Ezz49IaB_Z89kFyYE08lt3V1YyrFApuQ8"
    
    U2FsdGVkX183MTQyNzE0MvCYST-W4nASMwlt1CSfwR9wk0kEQRr6EDBqxe_cKs1tt3N92akbEm4
    ------------dQD6HRmfxrxw49A4m8uERh
    Content-Disposition: form-data; name="U2Fsd:.GVkX183MTQyNzE0MmWorycRBYg5XFIlxjF:D5DBBqA2R9Jzbqzk88G:q2R77y"
    
    Continue
    ------------dQD6HRmfxrxw49A4m8uERh--
    
    
    Thanks guys.