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

StackOverflow https://stackoverflow.com/questions/14513281

  •  17-01-2022
  •  | 
  •  

Question

I have included my index_login.php (the file with login form on it) to my index.php, and when I click to [Log In] it goes to login.php ( the file with checking if user exist and if exist says welcome etc.) but I want to make all login related files to be included in my index.php for easy editing of the template. I have tried several things but so far couldn't manage to achieve it, any help would be much appreciated. Thanks.

No correct solution

OTHER TIPS

Why not just direct to the same page? And then do something like this at the top.

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

//or continue execution normally
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top