php-general Digest 11 Oct 2012 20:07:28 -0000 Issue 8002

Topics (messages 319420 through 319421):

Re: cURL issues posting to an end point
        319420 by: Ian

Beneficial site spamming framework
        319421 by: Paul M Foster

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On 04/10/2012 15:54, Bastien Koert wrote:
> Hi All,
> 
> I have a page that receives third party data into my app, xml data via
> https post. This works fine and I receive the data as expected. The
> issue I am facing is around posting XML data back as a synchronous
> response to the post I receive. I am using the following code:
> 

<snip>

> 
>       $result = curl_exec($ch);
>       
>       curl_close($ch);
>       // Print CURL result.
>       echo $ch_result;
> }
> 
> 
> The endpoint recipient says they are not receiving the data and I am
> at a loss to figure out why. Any insight would be appreciated.
> 
> Thanks,
> 
Hi,

Try adding some error checking before and after the curl_exec() call:

// Check for an error
if(curl_errno($ch)>0){
        print "Error creating curl object: Err Number:".
                curl_errno($ch). " ,Description:" . curl_error($ch);
}

// Execute request
$result = curl_exec($ch);

// Check for an error again
if(curl_errno($ch)>0){
        print "Error executing query: Err Number:". curl_errno($ch).
                ", Description:" . curl_error($ch));
}

It may also be wise to increase your time out whilst testing, just in case.


Regards

Ian
-- 



--- End Message ---
--- Begin Message ---
Folks:

I've been getting spam comments on my personal blog (runs on
self-written PHP blog software). I'd like to test some methods I've
devised to prevent or block it. Does anyone know of a very lightweight
framework for simulating an automated "form fill-out" on a site?
Something where you could just add some code to designate the site for
the "attack" and then what fields you wanted to send?

This should be a relatively simple task for PHP and curl, but I'm not
really familiar with the headers and that part of the HTTP conversation.
Yes, I know this is a risky question for a public list. Feel free to
contact me privately if you think the answer shouldn't be in the
archives of a public list. Likewise, if you can point me to a source of
quickly absorbable research on the subject. I frankly don't know how I'd
google such a thing.

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com

--- End Message ---

Reply via email to