Q1A。我是否需要在发布到同一页面的以下关键字搜索表单上添加“enctype=”?
Q1B。真的有必要添加 enctype 吗?表单处理器将在 php.ini 中。
Q1C。注意“动作=”。如果“action=”包含一个已经是 urlencode() 的 url,它有什么区别吗?
<form method='POST' name='search' id='search' action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']).'?tbl='.urlencode($tbl).'&col='.urlencode($col).'&page='.urlencode($page);?>">
<label for='url'>Url</label><br>
<input type='url' name='url' id='url' maxlength="100" required><br>
<label for='anchor'>Anchor</label><br>
<input type='text' name='anchor' id='anchor' required><br>
<label for='anchor'>Username</label><br>
<input type="text" pattern="[a-zA-Z0-9]{5,8}" title="Type 5 to 8 alphanumeric characters">
<label for='email'>Email</label><br>
<input type='email' name='email' id='email' maxlength="100" required><br>
Q1D。如果表单通过 POST 方法提交到同一域/网站上的另一个页面,是否真的有必要添加 enctype ?
Q2。如果我使用“application/x-www-form-urlencoded”,那么这是否会以任何方式成为双重 urlencoding,因为我已经对目标 url 进行了 urlencoded 编码?
<form method='POST' name='search' id='search' action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']).'?tbl='.urlencode($tbl).'&col='.urlencode($col).'&page='.urlencode($page);?>">
Q3。如果我使用:
<form method='POST' name='search' id='search' action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']).'?tbl='.urlencode($tbl).'&col='.urlencode($col).'&page='.urlencode($page);?>">"
然后我必须在服务器端解码提交的数据还是什么?
Q4。还有什么我需要知道的吗?