Using Zend to Post Parameters With Curl

For this example, let’s say you have a site you want to post data to so a newly trained employee is added to a mailing list. In the older days of php, you could do this with http_post_params; however, this function is now deprecated. Instead, you can use the curl method, or you can use some Zend libraries.

Since this is a post on using Zend, I think you know which one I chose to do.

The following example is a really simple one. I’m just using a configuration file to hold my options and parameters to use for creating a curl request. Then I have a script that reads the config file, creates the request, sends the request, and then checks the response.