homepage Welcome to WebmasterWorld Guest from 54.205.236.46
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Accredited PayPal World Seller

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
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:

<?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?

 

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved