1℃
Apache、IIS、Nginx等绝大多数web服务器,都不允许静态文件响应POST请求,否则会返回“HTTP/1.1 405 Method not allowed”错误。
例1:用Linux下的curl命令发送POST请求给Apache服务器上的HTML静态页
[root@localhost ~]# curl -d 11=1 http://www.92csz.com/index.html
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
<TITLE>405 Method Not Allowed</TITLE>
</HEAD>
<BODY>
<H1>Method Not A...
GET, html, nginx, post阅读全文
表单按回车就自动提交的问题已关闭评论
1、当form表单中只有一个<input type="text" name="name" />时按回车键将会自动将表单提交。
<form id="form1" action="post.php" method="post">
<input type="text" name="name" />
</form>
再添加一个
<input type="text" />
按下回车将不会自动提交,但是页面上显示一个不知所云的输入框挺别扭,后从网上搜到两个解决办法:
(1)添加一个
<input style="display: none;" type="text" />
不显示输入框,然后回车之后也不会提交:
<fo...
html, input, php, submit, text阅读全文
html页面中调用nginx变量 [原创]已关闭评论
nginx配置如下:
location /viewimage/
{
if ($uri ~ /viewimage/([^/]*)/images/(.*))
{
set $attachName $1;
set $imageUrl images/$2;
rewrite ^/.*$ /imageborder.html break;
}
}
html页面中代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv=...
html, image阅读全文