I'm not sure why it should be, but index.html feels 'right'. I'm using index.php because if my login fails, I want to return to index.php and show the returned error on in the initial log-in page, like this...
<?php
if(isset($_GET["loginFailed"])) {
echo ($_GET['reason']);
}
?>
That's trimmed a bit, but the 'reason' will be deciphered by the php and a user-friendly error shown.
The login error is just returned from my 'login.php' with something like..
if($row === false) {
die(header("location:index.php?loginFailed=true&reason=usernamenotfound"));
}
This all works fine, but I have to keep the index named as index.php instead of index.html. If I change it to index.html, the php part is just ignored.
Is there anything wrong with my approach? Is it unsafe or anything?
index.php