尝试方法获得和$_GET
它工作完美,但当我尝试方法后,$_POST
或$_REQUEST
什么都不会发生= \任何帮助?感谢
PHP和形式是同一PAGE
HTML:
<form method="post">
<div class="form-group">
<label for="user">Meno:</label>
<input type="text" id="user" name="user" class="form-control" placeholder="meno admina" required>
</div>
<div class="form-group">
<label for="psw">Heslo:</label>
<input type="password" id="psw" name="password" class="form-control" placeholder="heslo admina" required>
</div>
<div class="form-group">
<input type="submit" class="btn btn-success" name="submit" v>
</div>
</form>
PHP:
<?php
if (isset($_POST["submit"])) {
$user = htmlspecialchars(strip_tags($_POST['user']));
echo $user;
}
?>
尝试也只是附和$_POST['user'];
,但没有。
你在同一个页面两个代码? –
“行动”在哪里?
@AlivetoDie同一页是 –