Click to See Complete Forum and Search --> : php and xml


TrailOfDead
02-27-2008, 06:09 AM
Hey. Im kinda fresh in working with xml in php, and I need to send xml to some adress like this:

http://api.something.com/etc/etc/api.jsp?xmlstring=<?xml version='1.0' encoding='ISO-8859-1'?><!DOCTYPE Customer SYSTEM 'http://api.something.com/etc/etc/api.jsp?xmlstring'>(rest of the xml)

It looks like everything will be sendt in the url. How am I gonna send and retrieve data using php?

TheRave
02-27-2008, 08:12 AM
Via the user?
Send - Link to the URL
Retrieve - $_GET['xmlstring']

From the php?
Send/Retrieve - use CURL

MrCoder
02-27-2008, 08:59 AM
<?php
ob_start();
?>
<?xml version='1.0' encoding='ISO-8859-1'?><!DOCTYPE Customer SYSTEM 'http://api.something.com/etc/etc/api.jsp?xmlstring'>(rest of the xml)
<?php
$xml = ob_get_clean();

$returned_data = file_get_contents("http://api.something.com/etc/etc/api.jsp?xmlstring=".$xml);

echo $returned_data;
?>