I had thought I would use curl for this but it looks like I was mistaken. What I need to do is catch a post and do some database lookups for validation purposes and then post the validated data to a remote URL.
I have done this by populating an html form and submitting it using javascript but this has obvious flaws. I want to construct a post and send the browser along exactly as if they had posted a form to the remote url.
Am I missing something in the curl docs? What is a Good™ way to do this?
You can use curl for this.
But you might have other issues to think about. Cookies, sessions etc are set when a browser physically posts to the another url. These might not be set when post from the server. You also should check out screen scraping questions on SO for more on this.
Assuming this is not the case, you should be able to get the post, validate the fields, and repost using curl. There are many many examples of doing this.
edit