Good morning, I have a problem. I am starting in php and what happens is that I divided my code into several files so as not to have everything jumbled up in a single file. I'm doing a login type entry however I have two options; one allows the login of the administrator and another of the user so I want to reuse the code that I have separately in a file called login:
<body>
<?php require 'vali.php' ?>
<?php require 'header.php' ?> <!--"require" pide la informacion de la direccion especificada-->
<h1>LOGIN</h1>
<form action="menu.php" method="post">
<input type="text" name="nick" placeholder="Nick" onkeypress= "return sololetras(event)" onpaste= "return false">
<input type="text" name="contrasena" placeholder="Contraseña">
<input type="submit" value="Entrar">
</form>
The problem now is that this form only redirects to "menu.php" which is the main administrator menu. What I want is that if in the index you select login as a user, send to the user's menu and if you select it as administrator, then send it to the administrator menu ... I was thinking about doing it with an if or something, but I do not know, or maybe what I'm asking is just ridiculous, I do not know; help please.
The code where I select if login as admin or user is:
<body>
<h1>SISTEMA TEST</h1>
<form class="" action="controlador/login.php" method="post">
<input type="submit" value="Administrador">
</form>
<form action="controlador/login.php" method="post">
<input type="submit" value="Usuario">
</form>
</body>