Jump to content

PHP + XML help


speedy33417

Recommended Posts

I'm working on a website that deals with an xml response. After an application is filled out on our website we get a response sent to us in $result

 

If the application is approved then it looks something like this:

 

<tss_loan_response><signature><data name="page">app_completed</data><data name="site_type">soap_oc</data><data name="license_key">sample</data><data name="promo_id">99999</data><data name="promo_sub_code"/></signature><errors/><content><section><verbiage><![CDATA[<br/>
<p>Thank you for your application. You have been approved. Please click <b><a href="http://www.somesite.com">here</a></b>to complete your application.</p><p>You will be automatically sent to the page in a few seconds.</p><script type="text/javascript">
var script_expression = "document.location.href = 'http://www.somesite.com'";
var msecs = 2 * 1000; setTimeout(script_expression, msecs);</script>
]]></verbiage></section></content></tss_loan_response>

 

 

I need pieces of code from the $result

 

1.  The code between <data name="page"> and </data>

2.  The code between <![CDATA[  and  ]]>

 

How would I get them in $page and $data???

Link to comment
Share on other sites

Thanks Darken.

 

I looked at the tutorial, but it's still not clear how I can get those two pieces of code that I need to display for the applicant.

 

I've never dealt with XML and it's totally new territory for me. I was hoping that I could maybe use regex to fish out the part that I need or any simple solution that would load the required part of the script into my variables.

 

Anybody else, pleeeeeeaaaaase?

Link to comment
Share on other sites

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.