我想POST用户表单将输入作为XML输入到URL并获取结果以将结果显示给用户。如何通过POST将HTML表单数据作为XML发布到URL并获取XML响应
HTML-部分:
<form id="postXmlForm" method="post">
<table>
<tr>
<td>Userinput1:</td>
<td><input type="number" id="userInput1" name="userInput1"></td>
</tr>
<tr>
<tr>
<td>Userinput2:</td>
<td><input type="text" id="userInput2" name="userInput2"></td>
</tr>
<tr>
<td colspan="2"><input type="Button" value="Send"></td>
</tr>
</table>
</form>
我应该张贴到网址:
<Request><input1>123456</input1>
<input2>textinoput</input2></Request>
我不确定,什么是最好的方式是将用户输入包装成一个字符串,将它作为XML发布到给定的URL并显示答案(XML)... jQuery? PHP的?
使用PHP SimpleXML解析器完成此任务 –