Hello,
im learning about post method and im having some problemas... could anyone post here a simple php code that would receive an specific post and return a XML file? (the part that send the post is done, i did it in C, but not the part to receive) its enough for me to understand how to use it in other ways (the tutorials i read didnt help enough...)
thx
post method example
Moderator: General Moderators
Re: post method example
The following code would accept posted xml data and save it in $data:
Code: Select all
$data = file_get_contents(‘php://input’);
Re: post method example
hm... actually i will send a string, and i want it to return the xml...
the post i must send is something like
"$POST[in_chktest] => xxx"
and i want it to check it and return diferent XML according to xxx
im using C funcions from libcurl library which will automaticaly get the result
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "$POST[in_chktest] => test");
result = curl_easy_perform(curl);
the post i must send is something like
"$POST[in_chktest] => xxx"
and i want it to check it and return diferent XML according to xxx
im using C funcions from libcurl library which will automaticaly get the result
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "$POST[in_chktest] => test");
result = curl_easy_perform(curl);