Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xml usage 1

Status
Not open for further replies.

delrose

Technical User
Mar 12, 2007
2
GB
Hi
Can anyone advise me where to place xml data. I've been supplied with a get date php scrip and the xml file, however I do not know where to place the info.

Any help would be appreciated
 
Thanks for the response. Please find PHP script below.

<?

$fp = fsockopen (" 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET /site/property-thirdparty.php?propertyCode=HIDFF&width=600&associateid=2416&url=http://www.yoursite.com/ HTTP/1.0\r\nHost: while (!feof($fp)) {
$line = fgets ($fp, 1024);
if (strcmp($line, "\r\n") == 0) {
// read the header
$headerdone = true;
}
else if ($headerdone)
{
// header has been read. now read the contents
$res .= $line;
}
}
fclose ($fp);

print($res);




}

?>
 
Since you repost in a deleted duplicated thread, I am willing to help. But whether you can get the essence of the thing, I leave it to the fate.

>Can anyone advise me where to place xml data. I've been supplied with a get date php scrip and the xml file, however I do not know where to place the info.

[1] Despite all the ambiguities, if you want to fetch data via a php script, you have to install php, preferrably v5+. Have you done so?

[2]>and the xml file, however I do not know where to place the info.

[2.1] With the provision of the php script, you do not need to place the xml source file to anywhere on your local m/c. The script is capable to getting the info via tcp transport to get the data where it is placed on the site of the one who supplies you the php script.

[2.2] If you manage your own site ( then you place the php script file (property-thirdparty.php) under the root folder, namely, the subdirectory ./site. The property-thirdparty.php file is endowed with the capability to interfacing with any needed third-tier db/xml source etc... and serve you the data stream. The shown script will print the data on the console. It would _not_ be enough to supply you the property-thirdparty.php and the posted script. You need more on the 3rd-tier of the architecture.

[2.3] I would say you leave the info on the site cited, and with the post script, you can simply run the script as an administration script and the data will be printed to the console. That would be the better solution if somebody else is doing the backend. You simply run the script means you can save the posted script practically _anywhere_ and you run it by the command line:
[tt]php.exe yourscript.php[/tt]
and that's all it needs do.

You've to read the above carefully to get the essence of the advice. (If you don't understand php, it may be hard to comprehend. But, you may as well ba an expert on php, I just don't know. If yes, I shouldn't say spend that much words.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top