Welcome to WebmasterWorld Guest from 184.108.40.206 , register , free tools , login , search , subscribe , help , library , announcements , recent posts , open posts Accredited PayPal World Seller
Sending XML data to local script for processing Works fine over HTTP, would rather use local file system MatthewHSE msg:4236961 5:53 pm on Nov 30, 2010 (gmt 0) I'm running a commercial API that is primarily meant to accept and process data from remote domains, but for my purposes, I only need to feed it data from the same domain the API resides on. Thus, while I can get the functionality I need by submitting data via HTTP, that just seems like a waste and I'd rather use the local file system. Here's the code I have now, which submits the data via HTTP:
$url = https://example.com/api.php; $xmlrequest = '<xmldata></xmldata>'; $opts = array('http' => array('method' => 'POST', 'header' => 'Content-type: text/xml', 'content' => $xmlrequest)); $context = stream_context_create($opts); $result = file_get_contents($url, false, $context); ?> What are some good ways to use the local file system instead? (I should mention that my host doesn't support the exec() function.) Any ideas?
coopster msg:4237511 7:04 pm on Dec 1, 2010 (gmt 0)
You may need to review the API instead. Seems it should be able to handle XML from an external source or fed directly, you just need to find the method that does that function.