Open browser page depending on XML results
Posted on
16th Feb 2014 07:03 pm by
admin
Hello,
I have some PHP code that sends webbased from data to an external url ( in the form of an XML data stream ) , and gets an XML data stream back.
I've got it displaying the stream via the browser ( using echo $req->getResponseBody(); ).
What I want to do is , instead of displaying the stream, is perform a query on it and redirect the browser to a specific page depending on the match or not.
Using this data (snippit):-
<?xml version="1.0" encoding="utf-8" ?>
- <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <soap:Body>
- <PerformMLCheckResponse xmlns="webpage">
- <CallResponse>
<AcrService>MoneyLaundering</AcrService>
<AcrSearchId>myid</AcrSearchId>
<AcrReference>refcode</AcrReference>
<AcrIntReference>externalcode</AcrIntReference>
<AcrExtReference>externalcode</AcrExtReference>
<AcrDateTime>2009-10-25T15:15:26.865625+00:00</AcrDateTime>
<AcrAccept>Y</AcrAccept>
<AcrFormatted>Y</AcrFormatted>
<AcrXmlDetail>Y</AcrXmlDetail>
- <AcrResponseDetail>
- <AcdElectoral>
<AerUsed>Y</AerUsed>
<AerValid>Y</AerValid>
<AerPafMatch>Y</AerPafMatch>
<AerForename>David</AerForename>
<AerOthernames />
<AerSurname>Brent</AerSurname>
- <AerAddress>
<AadAbode />
<AadBuilding>22</AadBuilding>
<AadStreet>test town</AadStreet>
<AadLocality />
<AadPostTown>test street</AadPostTown>
<AadPostcode>GU99 1AP</AadPostcode>
</AerAddress>
<AerStartDate>1996-10-28</AerStartDate>
<AerMonths>110</AerMonths>
<AerOptOut>Y</AerOptOut>
<AerPriorFlag>N</AerPriorFlag>
</AcdElectoral>
- <AcdCreditHistory>
<ChyUsed>Y</ChyUsed>
<ChyType>superuser</ChyType>
I thought I could use :-
$xmlresults = $req->getResponseBody();
$CallResponse = $xmlresults->CallResponse;
$AcdCreditHistory = $CallResponse->AcdCreditHistory;
$ChyType = $AcdCreditHistory->ChyType;
to load the data into a variable ( in this case "superuser" ) and then perform an "if ...Else" on that, but I'm new to PHP and a little lost.
Any ideas ? I'm I looking in the right area ?
Many thanks
No comments posted yet
Your Answer:
Login to answer
117
14
Other forums
Pipe email to PHP - get mail adress from MySQL - send?
Hi all,
this is the challenge:
1) Our faculty at the college where I'm employed includ
php code generators
All
Whilst enjoying learning a new language i have come accross a number of free code generat
Edit MySQL Row Using PHP and HTML Form
Hello,
Here's what I'm trying to do. Build a page where a user enters a MySQL row number in.
Passing variables with pagination - iterating through unique id per link
Hi everyone,
I have seen a few topics like this one. Still cant find the specific thing, so I am
There was a problem with the request. (Code: 0)
Any Idea what could cause this? I get it randomly at best. But with both IE and FF. It derives from
Get content from table into a list, without repeating.
Alright this is kinda an odd thing, so I need some help.
I have a table "quote" wit
PHP Script runs on CLI but not through web browser
I am running into an issue that I just can't seem to find the answer to. I have a Windows Server 200
How do I create a 2D game "camera" to follow player?
In J2ME programming I'm targeting MIDP 2.0 devices.
I'm using gamecanvas and I was thinking t
Something like an INI editor or a DelimitedText-Editor
Hi all,
Am very, very, very new to PHP and not sure if I should be posting this to a Javascri
How do I use ValidatorCallout extender in Login control?
Hi,I'd like to customize the look and feel of the login control a little bit. One thing I'd love to