Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dbHost="localhost";
- $dbUsr="lettore";
- $dbPass="";
- $dbName="negozio";
- $conn=new mysqli($dbHost,$dbUsr,$dbPass,$dbName);
- // la connessione è attiva?
- if($conn->connect_error)
- {
- die("connessione fallita ".$connect_error);
- }
- else
- {
- $query = "select tipoAccount from account where username ='" .$_POST['username']."' and password ='".$_POST['password']."'";
- echo $query;
- $risultato=$conn->query($query);
- $riga = $risultato->fetch_assoc();
- $tipo = $riga['tipoAccount'];
- if ($tipo == "A")
- {
- header( 'Location: http://localhost:8080/negozio/registrazione.php');
- }
- if ($tipo == "E")
- {
- header( 'Location: http://localhost:8080/negozio/esperto.php');
- }
- }
- ?>
- ----------------------------------
- <!DOCTYPE html>
- <html>
- <body>
- <h1>Benvenuto ADMIN!</h1>
- <!-- AGGIUNGERE UTENTI -->
- <form name="Inserisci" action="inseriscibyAdmin.php" method="post">
- Username: <input type="text" name = "username" value=""/> </br>
- Password: <input type="password" name= "password" value=""/></br>
- Tipo Utente:
- <select name = "tipo">
- <option value="A">Admin</option>
- <option value="E">Esperto</option>
- </select>
- </br> <input type="submit" value="Inserisci"/>
- </form>
- <!-- FINE AGGIUNTA UTENTI -->
- </body>
- </html>
- --------------------------------------------------
- <!-- FORM LOGIN -->
- <form name="login" action="login.php" method="post">
- username: <input type="text" name = "username" value=""/> <br />
- password: <input type="text" name ="password" /> <br />
- </br> <input type="submit" value="login"/>
- </form>
- <!-- FINE FORM LOGIN -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement