Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

coldfusion cfhttp to PHP

I've designed a website Im running for a sports team I coach in Wordpress (more specifically PHP). For the past few years we have used an online web service that runs a stats based program in Coldfusion. They recently opened up a feed so users can use there own customized websites with their data implemented in it.

They provided me with a feed like so (not going to provide my details for security reasons):

<cfhttp url="http://datafeed" method="post" result="result">
            <cfhttpparam type="formfield" name="seasonID" value="29725">
            <cfhttpparam type="formfield" name="codekey" value="mycodekey">
<cfhttpparam type="formfield" name="showGameType" value="RS">
</cfhttp>

I have no experience with Coldfusion what so ever and I've tried to do some reading about using this in a PHP environment but everything I tend to find is PHP to Coldfusion, not the opposite.

Because of this I come to stack, Im not entirely sure how this would work within PHP but would cURL be the answer? Ideally Id like to just create a couple wordpress functions and call them on my template pages.

like image 400
Phrosty30 Avatar asked Aug 01 '12 19:08

Phrosty30


1 Answers

The code example you have there is a simple form style http post with the response from the post being written to the variable "result".

The form post contains three fields; "seasonid", "codekey" and "showgametype".

To be honest I have no clue how you would write it in PHP, cURL is the library you will need to use. The examples in the comments on the main cURL page look to do what you would need; capture the http response from a post or get to a URL.

Hopefully my description of what the example code is doing will help you determine your course.

like image 71
Stephen Moretti Avatar answered Oct 20 '22 11:10

Stephen Moretti