Web Hosting, Design, & Coding forum

General discussion

PHP5 / XML API help!

by Oskare100 / October 15, 2007 1:49 AM PDT

I'm trying to prase and use information I'm getting from an XML API in my system. The user is supposed to be able to choose between the returned agents and then select one of them. When they click "continue" or similar the rows of the agent that the user selected should be saved/assaigned to different PHP variables.

Here is the structure of the XML return:
<message>Your request was successfully processed.</message>
<data index="0">
<agent index="0">
<name>AGENT & CO IT</name>
<address>STREET ADDRESS 2</address>
<agent index="1">
<name>ANOTHER AGENT</name>
<address>STREET ADDRESS 5</address>

Now I need to list the agents so that the user can select one of them.. I've understood that I should use SimpleXML for this since it is the easiest way.

$xml = simplexml_load_file($request_url) or die("feed not loading");

That about what I've managed to do, I understand that in some way I need to list the different agents.

[PHP]foreach ($xml-> ...? ) (
print ?

Then I would need to add so that the user can select one of the returned agents and click continue and that my script then can get the rows/information about the selected agent. Maybe HTML POST/GET but I don't know how to make it do that...

I appreciate any help, links, code or whatever I can use to solve this problem.


Discussion is locked
You are posting a reply to: PHP5 / XML API help!
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: PHP5 / XML API help!
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Popular Forums
Computer Newbies 10,686 discussions
Computer Help 54,365 discussions
Laptops 21,181 discussions
Networking & Wireless 16,313 discussions
Phones 17,137 discussions
Security 31,287 discussions
TVs & Home Theaters 22,101 discussions
Windows 7 8,164 discussions
Windows 10 2,657 discussions


Help, my PC with Windows 10 won't shut down properly

Since upgrading to Windows 10 my computer won't shut down properly. I use the menu button shutdown and the screen goes blank, but the system does not fully shut down. The only way to get it to shut down is to hold the physical power button down till it shuts down. Any suggestions?