I'm doing a cfhttp post to a PHP page:
<cfhttp method="Post" url="https://www.example.com/ssl/roundpoint.php" result="mlResponse">
<cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0">
<cfhttpparam type="Header" name="TE" value="deflate;q=0">
<cfoutput>
<cfif isdefined( "ppcid" )><cfhttpparam name="PPCID" type="formField" value="#PPCID#"></cfif>
<cfif isdefined( "product")><cfhttpparam name="PRODUCT" type="formField" value="#PRODUCT#"></cfif>
<cfif isdefined( "va_status" )><cfhttpparam name="VA_STATUS" type="formField" value="#VA_STATUS#"></cfif>
<cfif isdefined( "qs_product")><cfhttpparam name="QS_PRODUCT" type="formField" value="#QS_PRODUCT#"></cfif>
<cfif isdefined( "prop_st" ) and prop_st neq ""><cfhttpparam name="PROP_ST" type="formField" value="#PROP_ST#"></cfif>
</cfoutput>
</cfhttp>
On the PHP page, I do a cURL function, look for a specific value in the result and save it:
$pstVars = '';
if (count($_REQUEST) > 0) {
foreach($_REQUEST as $key=>$value) {
$pstVars .= $key . '=' . urlencode($value) . '&';
}
$pstVars .= 'ON_SUBMIT=YES';
//the SSL/ORGANIC redirect API url
$url = 'https://www.example.com/ssl/redirect.php';
//make the server-side redirect API call
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $pstVars);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//store the result from the API call
$roundpoint_result = curl_exec($ch);
// LOOKING FOR ROUNDPOINT FLAG
$rpVals = substr($roundpoint_result, 0, 10);
For testing purposes, I've e-mailed myself the $rpVals value to make sure it's correct. I need to pass that value back into the Coldfusion page. I've tried passing the value into a cookie:
setcookie('RPCOOKIE', $rpVals, time()+60*60*24*2, '/', '.example.com');
and tried to read it on the ColdFusion page:
<cfparam name="RPCOOKIE" default=""/>
<cfcookie name="RPCOOKIE" value="#RPCOOKIE#">
But I haven't had any luck with this, either setting the cookie or reading it in ColdFusion. Any suggestions?
(FYI - The Coldfusion page will be re-written in PHP in a few weeks, but the client is requesting something time sensitive).