How to post Xml data without form in PHP and receive
=====================================================
If it is not working in localhost/localsystem, try to run it in from live server.
here is the first file which will send xml data
vp-post4.php
-------------
< ? php
#get the xml data from xml file which you want to post
$xml = file_get_contents("temp1.xml");
$context = stream_context_create(array('http' => array(
'method' => "POST",
'header' => "Content-Type: text/xml",
'content' => $xml
)));
// put here host name with page name.
// if it is not working in local try to run it in live server.
$file = file_get_contents("http://localhost:90/post/vp-postget4.php", false, $context);
echo $file;
?>
here is the second file which will receive xml data
vp-postget4.php
-------------------
< ? php
$xml = file_get_contents("php://input");
// perform here your operation for received xml data
/////// .....
/////// .....
echo "received data is : ".$xml;
?>
Find interesting stuff in Java, PHP and Dot Net.
Stop writing good code; Start writing Innovative code.
This site is from FUTURE. Science is powerful, but it cannot explain everything.
This site is for smart Primates & ROBOTS only (oh and A L I E N S).
Pages
- Home
- Send problem from my FaceBook Page
- Your FB bio/friends
- Auto Resume Broken File Uploader
- Screen Recorder
- Facebook App
- Screencast with Audio Capture
- Web Page Screen Capture As Image
- Add Watermark In Video
- Unique Code
- PDF Merger
- Unique Software
- Latest Posts
- Arbitrary Text in PDF
- MY ANDROID APP
- Torch in Android
Search This Blog
Top Ads
Tuesday, December 29, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment