When my users first go to the website, they use the URL http://www.example.com and they are redirected to http://www.example.com/index.php/Security/login?BackURL=%2F, if they try to login, they are redirected back to that same page.
My login form has the following code that refers to the BackURL:
if (isset($_REQUEST['BackURL'])) {
$backURL = $_REQUEST['BackURL'];
} else {
$backURL = Session::get('BackURL');
If I click on the logo, the page refreshes and takes me to http://www.example.com/index.php/Security/login?BackURL=%2Findex.php%2F and then they can login successfully. Is there any way to fix it so when they enter http://www.example.com, they are taken to http://www.example.com/index.php/Security/login?BackURL=%2Findex.php%2F. I feel like I’m missing an if\then statement that would be the catchall for when they go to the root and don’t enter the index.php.
I'm new to PHP and web development in general, but it seems to me there should be a way to say if the BackURL variable is null then backurl=index.php