Jump to content

Recommended Posts

Hi,

I submit form data as an xml string -  $strXML - using curl:

 

curl_setopt($ch, CURLOPT_HEADER, 0);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, '1');

curl_setopt($ch, CURLOPT_POST, true);

curl_setopt($ch, CURLOPT_POSTFIELDS, array('lead'=>$strXML));

$strResult = curl_exec($ch);

// close cURL resource, and free up system resources

curl_close($ch);

 

The xml response is:

 

<result>

      <posting_error>0</posting_error>

      <lead>0</lead>

      <valid>1</valid>

      <redirect_url>http://www.xxx.com</redirect_url>

</result>

 

and I need to redirect the user to <redirect_url>.

 

I am trying the following:

 

$xml = new SimpleXMLElement($strResult);

header("Location:" . $xml->result->redirect_url);

 

but with no joy.

Could anyone suggest how I can achieve what I want?

Thanks.

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.