Returning a PHP value to a Coldfusion page? -
i'm doing cfhttp post 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" ) , prop_st neq ""><cfhttpparam name="prop_st" type="formfield" value="#prop_st#"></cfif> </cfoutput> </cfhttp>
on php page, curl function, specific value in result , save it:
$pstvars = ''; if (count($_request) > 0) { foreach($_request $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 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 result api call $roundpoint_result = curl_exec($ch); // looking roundpoint flag $rpvals = substr($roundpoint_result, 0, 10);
for testing purposes, i've e-mailed myself $rpvals value make sure it's correct. need pass value coldfusion page. i've tried passing value cookie:
setcookie('rpcookie', $rpvals, time()+60*60*24*2, '/', '.example.com');
and tried read on coldfusion page:
<cfparam name="rpcookie" default=""/> <cfcookie name="rpcookie" value="#rpcookie#">
but haven't had luck this, either setting cookie or reading in coldfusion. suggestions?
(fyi - coldfusion page re-written in php in few weeks, client requesting time sensitive).
Comments
Post a Comment