This topic is locked

Additional Login Page

11/19/2020 4:23:39 PM
PHPRunner General questions
milver author

Hello Guys!
How to choose via code, which login page do I want to start my application with?
I tried:
function AfterAppInit()

{

header("Location: login.php?page=login1");

exit();

}
but, don't work.

Admin 11/19/2020

Definitely don't do this in AfterAppInit, you won't be able to logon and will just stay on the login page.
Explain the whole scenario, when ar you supposed to see the first login page, when are you supposed to see the second one?

milver author 11/19/2020



Definitely don't do this in AfterAppInit, you won't be able to logon and will just stay on the login page.
Explain the whole scenario, when ar you supposed to see the first login page, when are you supposed to see the second one?


[size="3"]I do the first login normally, [/size]to set some sessions according to my needs, then I log off:

[size="3"]

[/size]

[size="3"]

[/size]
[size="3"]So at that moment:[/size]

[size="3"]if the session is different from empty redirect to page: login_custom[/size]

[size="3"]

[/size]

[size="3"]else[/size]
redirect to page: [size="3"]login_default[/size]
[size="3"]Note: I would like two login pages to be able to customize in a simpler way.[/size]

Admin 11/20/2020

I don't understand what "if the session is different from empty" means but if you do a redirect from your code you can simply do in PHP:

header("Location: login.php?page=login1");

exit();


or in Javascript

location.href="login.php?page=login1";
milver author 11/22/2020



I don't understand what "if the session is different from empty" means but if you do a redirect from your code you can simply do in PHP:

header("Location: login.php?page=login1");

exit();


or in Javascript

location.href="login.php?page=login1";



Good night, I tried both ways, but without success. I already use additional pages within my project but only on the login page I cannot redirect



milver author 11/23/2020

Entering the URL directly into the browser, always show me the default login page:



Admin 11/23/2020

You cannot redirect in "Login page: BeforeProcess event", doesn't make much sense as it will lead to a redirect loop.
Again, you need to explain your whole logic. What "if the session is different from empty" means?

milver author 11/23/2020

[size="4"]Ok, i will try another way:[/size]
[size="4"]1 - I log in as an administrator[/size]
[size="4"]2 - when clicking the button:[/size]
[size="4"][server][/size]
[size="4"]$_SESSION["UNIDADE"] = $data_unidade["unidade"];[/size]

[size="4"]$_SESSION["NOMESALA"] = $record["sala"];[/size]
[size="4"][Client After][/size]

[i][size="4"]


[size="4"]But, although the URL is showing the correct address, the page being displayed is the default login page and not the custom page. [/size]

[size="4"][color="#ff0000"]Note: The text: custom page, is not displayed!![/size]

Admin 11/23/2020

Just wanted to add - we found out that this is a bug in PHPRunner, specifically related to additional login pages. We will fix it shortly.

milver author 11/24/2020



Just wanted to add - we found out that this is a bug in PHPRunner, specifically related to additional login pages. We will fix it shortly.



Ok! Thank you!