doujindou4356 2016-10-19 00:32
浏览 49
已采纳

提交按钮没有按下isset()调用

I have a PHP form set like this

<?php if (isset($submitted)) {
$output = checkData(); 
if (!is_null($output))
{
    echo '<script type="text/javascript">alert("' . $output . '"); </script>';
}
else 
{
    createMeeting();
    echo '<script type="text/javascript">alert("You meeting has been created. All of the recipients should shortly receive an email"); </script>';
    header('Location: index.php');
}   
} else { ?>
<center>
<form method="POST">
...
<input type="submit" name="submitted" value="Create Meeting">
</form>
<?php 
} 
?>

When I run it through a PHP code checker (codechecker website), no errors are returned. However, when I click on the submit button, the isset($submitted) code never seems to be executed (I've tested this by adding some echo statements in that section of the code).

If I click on the submit button, the form is cleared, so something is happening. I've put a number of different actions in, but the code is still not hit.

  • 写回答

2条回答 默认 最新

  • doukekui0914 2016-10-19 00:38
    关注

    This if (isset($submitted))... should be if (isset($_POST['submitted']))...

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!