Problem to retrieve form data from XML page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
milfo
Forum Newbie
Posts: 2
Joined: Tue Oct 11, 2011 7:17 pm

Problem to retrieve form data from XML page

Post by milfo »

Hi,
I’ve got a problem to retrieve form data from Php page that produce an XML.
I’m trying to explain better.
I send form data from PageA to PageB, PageB is a PHP file that produce an XML output like this:
<response>
<status></status>
<message></ message >
<id_costumer/>
</response>

If the form field of pageA is inputted correctly, pageB return status “OK”, message “Thank you to fill our form”, and Id_costumers “autoincremented id example 123” and the output is in XML like above.
So, the problem is that the pageB is not on my server, how can I parse the Xml file and intercept the value of the above tag submitted by pageA?
If I parse the XML file with direttive include like this:

Code: Select all

<?php
include 'http://www.site.com/pageB.php';

$movies = new SimpleXMLElement($xmlstr);

…
?> 
it's seems doesn't work and I can’t to retrieve any form value of the pageA.
Please help me, I'm so frustrated, any suggestion will be appreciated.

Thanks
Ric
ouchiko
Forum Commoner
Posts: 35
Joined: Sun Oct 09, 2011 6:54 pm
Location: London

Re: Problem to retrieve form data from XML page

Post by ouchiko »

What the actual URL - SimpleXML does not handle xmlns namespaces very well.
milfo
Forum Newbie
Posts: 2
Joined: Tue Oct 11, 2011 7:17 pm

Re: Problem to retrieve form data from XML page

Post by milfo »

Would you like to know the exact page's URL?
ouchiko
Forum Commoner
Posts: 35
Joined: Sun Oct 09, 2011 6:54 pm
Location: London

Re: Problem to retrieve form data from XML page

Post by ouchiko »

Well yeh, almost impossible to work out your problems without understanding what type of XML its loading..
Post Reply