# Seeking Assistance

**URL:** <https://forum.kirupa.com/t/seeking-assistance/293624>\
**Category:** programming\
**Created:** [July 31, 2009, 1:07pm UTC](https://forum.kirupa.com/t/seeking-assistance/293624 "2009-07-31T13:07:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alextrevino](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@alextrevino](https://forum.kirupa.com/u/alextrevino)\
**Post date:** [July 31, 2009, 1:07pm UTC](https://forum.kirupa.com/t/seeking-assistance/293624/1 "2009-07-31T13:07:52Z")

</div>

I am currently trying to develop a program which will perform an HTTP GET to our inventory hosted on a third party vendor. I am capable of getting into the database and have a response coming back. When I run the program (E.g. inventory.php) and viewthe page source I see the XML. My question is how do I go about saving that XML into a document or a string for use later in parsing out into tables?

This is my code as of now.

[COLOR=red]\<?php[/COLOR]

$path = [COLOR=red]"[/COLOR][COLOR=red]/cdmapi/dlapi.asmx/DLAPI?Request=string&DealerID=string&LoginID=string&Password=string[/COLOR][COLOR=red]"[/COLOR];  
$port = [COLOR=red]80[/COLOR];  
$host = [COLOR=red]“[api.cdmdata.com](http://api.cdmdata.com)”[/COLOR];

[COLOR=green]if[/COLOR] ([COLOR=blue]count/COLOR \> [COLOR=red]1[/COLOR]) $path = $argv[[COLOR=red]1[/COLOR]];  
[COLOR=green]if[/COLOR] ([COLOR=blue]count/COLOR \> [COLOR=red]2[/COLOR]) $port = $argv[[COLOR=red]2[/COLOR]];  
[COLOR=green]if[/COLOR] ([COLOR=blue]count/COLOR \> [COLOR=red]3[/COLOR]) $host = $argv[[COLOR=red]3[/COLOR]];  
$address = [COLOR=blue]gethostbyname/COLOR;  
$socket = [COLOR=blue]socket\_create[/COLOR](AF\_INET, SOCK\_STREAM, SOL\_TCP);  
[COLOR=blue]socket\_connect[/COLOR]($socket, $address, $port);  
$in = [COLOR=red]"GET $path HTTP/1.0

"[/COLOR];  
[COLOR=blue]socket\_write[/COLOR]($socket, $in, [COLOR=blue]strlen/COLOR);

[COLOR=green]while[/COLOR] ($out = [COLOR=blue]socket\_read[/COLOR]($socket, [COLOR=red]4096[/COLOR])) {  
[COLOR=blue]echo[/COLOR] $out;  
}

[COLOR=blue]socket\_close/COLOR;

[COLOR=red]?\>[/COLOR]

[COLOR=black]Thank you much in advance. Also if you have an links to any tutorials on this subject it would be greatly appreciated. [/COLOR]

You may contact me directly with any advice. [atrevino@cavenderauto.com](mailto:atrevino@cavenderauto.com)
