【发布时间】:2015-03-10 12:12:09
【问题描述】:
我有以下几点: 提交时需要从密码切换为文本的第一个输入。
<input type="password" name="test" value="hidden123">
第二个输入是改变输入字段的关键。
<input type="text" name="key">
提交:
<input type="submit" name="grant" value="unlock">
最后是 PHP 代码:
<?php
if(isset($_POST['grant'])){
$pass=$_POST['test'];
$key=$_POST['key'];
$unlock = "123";
if ( $key == $unlock ) {
//change this so the input field 'test' changes to text rather than password
echo "success";
} else {
echo "fail";
}
}
?>
【问题讨论】:
-
请更具体。您想在表单和输入类型更改的情况下显示 HTML?在
echo "success";之前你想做什么? -
毫无意义。为什么需要在提交时更改类型?你是什么意思“改变领域的关键”?
-
你在用ajax吗?否则您永远无法在提交时更改某些内容,您只能更改下一页,由 Harpartap 描述