Hi, I'm developing a web app, but I think that maybe I'm not doing it the right way. See, for each page I take the GET variables from url, for instance:
That way, the index gets the variable and displays the right page, in this case, the registration page. But I do it this way:
<?php
include "page/header.php";
if($_GET['mode']==='register'){
//code for registration
//this next file contains the HTML for the registration page.
include "mod/register.php";
}elseif($_GET['mode']==='login'){
//code for login
include "mod/login.php";
}else{
include "mod/404.php";
}
?>
include "page/footer.php";
Is that a good way of handling different pages from a single index.php? or is there a better way? because, to be honest, it's kinda difficult to develop this way. Especially when you create a header.php and a footer.php, where the header file contains the css link.