Welcome to WebmasterWorld Guest from 54.163.168.15

Forum Moderators: coopster & jatar k

Sending XML data to local script for processing

Works fine over HTTP, would rather use local file system

   
5:53 pm on Nov 30, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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:

<?php
$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?
7:04 pm on Dec 1, 2010 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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.
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month