<form>
<button name="submit1" value="submit" type="submit" class="btn red">Send Message</button>
</form>
<?php
if(isset($_POST['submit1']) and !empty($_POST['submit1'])){
echo 'in';exit;
}
?>
我有一个表单,并在同一页面上提交我已经php hat检查'isset'或不。但我想使用print_r()在屏幕上打印? echo'test';,但它不打印任何东西。请尽快帮助
答案 0 :(得分:1)
请记住指定表单方法:
<form action="" method="POST">
<button name="submit1" value="submit" type="submit" class="btn red">Send Message</button>
</form>
<?php
if(isset($_POST['submit1']) && !empty($_POST['submit1'])){
echo 'in';
exit;
}
?>