我已经在网络上查找了大概一个常见而简单的任务,并且只发现了死角。我试图从自己的HTML页面获取响应,该页面使用POST将数据提交到网站,以便我可以解析它并在同一个html页面上显示/打印解析后的文本。 这里是我的html页面看起来像什么:从窗体POST获取响应POST
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<form
method="post"
action="http://somesite.com"
enctype="multipart/form-data">
<input type="hidden" name="function" value="login">
<input type="text" name="username" value="client">
<input type="text" name="password" value="qwerty">
<input type="file" name="upload">
<input type="text" name="upload_to" value="0">
<input type="text" name="upload_type" value="0">
<input type="submit" value="Send">
</form>
</head><body></body></html>
开始将'form'元素移动到'body'元素中。它不应该在你的文档的头部。 – 2010-10-14 13:15:39
基本示例:http://www.w3schools.com/php/php_forms.asp – Shoban 2010-10-14 13:15:42
**危险**:来自W3Schools的“基本”示例存在XSS安全漏洞。避免W3Schools,因为这是典型的。 – Quentin 2010-10-14 13:26:41