Script POST issues Craigslist

Discussion in 'PHP' started by dor@tehexploa, May 29, 2009.

  1. #1
    post method:
    function post($posturl,$postarray) 
    {
    	$process = curl_init();
    	curl_setopt($process, CURLOPT_VERBOSE, 1);
    	curl_setopt($process, CURLOPT_POST, 1);
    	curl_setopt($process, CURLOPT_POSTFIELDS, $postarray);
    	curl_setopt($process, CURLOPT_HEADER, 1);
    	curl_setopt($process, CURLOPT_HTTPHEADER, $this->headers);
    	curl_setopt($process, CURLOPT_USERAGENT, $this->user_agent);
    	if ($this->cookies == TRUE) curl_setopt($process, CURLOPT_COOKIEFILE, $this->cookie_file);
    	if ($this->cookies == TRUE) curl_setopt($process, CURLOPT_COOKIEJAR, $this->cookie_file);
    	curl_setopt($process, CURLOPT_ENCODING , $this->compression);
    	curl_setopt($process, CURLOPT_TIMEOUT, 30);
    	curl_setopt($process, CURLOPT_REFERER, 'https://post.craigslist.org/atl/P/cas/none/x');
    	curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
    	curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
    	curl_setopt($process, CURLOPT_URL, $posturl);
    	$return2 = curl_exec($process);
    	curl_close($process);
    	return $return2;
    }
    Code (markup):
    var_dump($postarray);
    array(21) { ["postingKey"]=>  string(18) "NPliIveXT32BGjHG " ["test"]=>  string(7) "2xt94 " ["U2FsdGVkX183MTYzNzE2Mye6CLQViK7aWtNKNcg8-2O5qPW1C8MeuXHcuWB2ElqnIMgfoot5gHw"]=>  string(77) "U2FsdGVkX183MTYzNzE2MyCKzn62tRGhkUceku-H7bDhVj0lWE7qt6fSeSJDRikNpxFzgCd2Cpc " ["U2FsdGVkX183MTYzNzE2M2f8bCTdTD2HFaxGvc-2MJnrG32jI2SyYqx7k8kpeNVhkr8zdveysCY"]=>  string(45) "This is where you type the title of the ad. " ["U2:Fs:dGVkX183MTYzNzE2M94Ay6xSYcOrVVHGKjqGwUHea3PiPTrVg.w"]=>  string(35) "This is where you enter your age. " ["U2FsdGVkX183M:TYzNzE2M7zu.5V0GBoN94_RbBrtwxHp1HsRWu8Z:T10P6hNrCRE4:EFaw7_OfMPDo"]=>  string(49) "This is where you enter your specific Location. " ["U2FsdGVkX183MTYzNzE2M3FertAc39sUN-ay.L_j4rQ:ohTYYBg5kd-Al7Rq_wTRsn"]=>  string(53) "This is where you enter your E-mail the first time. " ["U2FsdGVkX183MTYzNzE2M:4HpaDsp2U.ndb0NQXwkZQDL6ALXhylZfawwrZONRkhLQAFyVZ8HQVsU"]=>  string(54) "This is where you enter your E-mail the second time. " ["U2FsdGVkX183:MTYzNzE2M8h6bEZ4fXEkyJliFcmrYHr3H-J:IflwlM5-z4Ph2Ie96"]=>  string(1) "C" ["U2FsdGVkX183MTYzNzE2Mye6CLQViK7aWtNKNcg8-2O5qPW1C8MeuXHcuWB2Elqn_kigKiGYBd4"]=>  string(77) "U2FsdGVkX183MTYzNzE2MyCKzn62tRGhkUceku-H7bDhVj0lWE7qt6fSeSJDRikN9cfQQec6TrU " ["U2FsdG::VkX183MTYzNzE2M8M:JowFEbCognzzJca.qhNzn5vjh5G41WTOoYexpUN3xK"]=>  string(45) "This is where you type your AD DESCRIPTION. " ["image1"]=>  string(3) "add" ["imgfile1"]=>  string(1) "@" ["image2"]=>  string(3) "add" ["imgfile2"]=>  string(1) "@" ["image3"]=>  string(3) "add" ["imgfile3"]=>  string(1) "@" ["image4"]=>  string(3) "add" ["imgfile4"]=>  string(1) "@" ["U2FsdGVkX183MTYzNz:E2M1bJXv3koO18LDnoRyshpiia.SmCRN_Mlla-e_Ibdj.kIzy2F4lrPiGQI"]=>  string(66) "U2FsdGVkX183MTYzNzE2Mzc-e-sXIeS_grZRuwxEFACPfS_1a4VODG1QPsBnozpP " ["U2FsdGVkX1.83MTYzNzE2Mzc-e-sXIeS_3D:rWO.vxMiEHvVTUNgJSlqUk.g3YQKf-8N"]=>  string(10) "Continue " } 
    Code (markup):
    See anything wrong with these? whenever I attempt to POST nothing happens. the array is made each time the script is run. it parses the source code for those sneaky "hidden" classes and inputs them in the array in the order in which they'd post in a regular browser.. any ideas?
     
    dor@tehexploa, May 29, 2009 IP
  2. exodus

    exodus Well-Known Member

    Messages:
    1,900
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    165
    #2
    exodus, May 30, 2009 IP