This is not exactly "an Alert login", but a login via HTTP Basic Authentication
;
Specifically this screenshot appears to be from an authentication of HTTP Basic Authentication
, can even login directly to the URL as http://nome:[email protected]
.
You can read more about it here.
If you really want to use this type of authentication and break display two forms in a single "Alert" this is the only solution as far as you know.
It is worth noting that the display of such "Alert" can change according to the browser, not necessarily will be shown this way.
I believe @lfarroco’s solution, using modal, is better and does not require changes to PHP code, or are minor changes than migrating to another type of authentication.