如何在单击已包含文件的链接时包含第二个文件


How to include a second file when clicked a link on already included file?

我已经将我的index_login.php(带有登录表单的文件)包含在我的索引中.php,当我单击[登录]时,它会进入登录.php(检查用户是否存在的文件,如果存在则表示欢迎等),但我想将所有与登录相关的文件都包含在我的索引中.php以便于编辑模板。我已经尝试了几件事,但到目前为止无法实现它,任何帮助将不胜感激。谢谢。

为什么不直接转到同一页面?然后在顶部做这样的事情。

if(isset($_POST['whatever'])) {
  //process login stuff
  //redirect home and die if you want
}
//or continue execution normally