Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Invio dati </title>
- </head>
- <body>
- <?php
- include_once('fix.php');
- $host = 'localhost';
- $user = '';
- $password = '';
- $database = 'my_itetsturzo';
- $nometabella = "GestioneCorsoSicurezzaEasyTGBot";
- $nomedb = "GestioneCorsoSicurezza";
- $dbname = "my_itetsturzo";
- $DATA = "$dbname.$nomedb$TGBot->table_name";
- $conn = new PDO("mysql:host=$host;dbname=$database", $user, $password);
- try {
- // stringa di connessione al DBMS
- $conn = new PDO("mysql:host=$host;dbname=$database", $user, $password);
- /*
- Avremmo potuto anche omettere dbname in questo modo:
- $connessione = new PDO("mysql:host=$host", $user, $password);
- */
- // notifica in caso di connessione effettuata
- echo "Connessione a MySQL tramite PDO effettuata.";
- // chiusura della connessione
- }
- catch(PDOException $e)
- {
- // notifica in caso di errore nel tentativo di connessione
- echo $e->getMessage();
- }
- $nominativo= $_POST['Codice'];
- $nome= $_POST['CodiceNome'];
- $cognome = $_POST['CodiceCognome'];
- $dbname = "my_itetsturzo";
- $stmt = $conn->prepare("INSERT INTO $DATA(`Userid`,`Nome`,`Cognome`) VALUES (`$nominativo`,`$nome`,`$cognome`");
- $stmt->execute([$nominativo,$nome,$cognome]);
- ?>
- <p>I dati sono stati inseriti correttamente</p>
- <p> Per vedere l'intera blacklist clicca sul pulsante "Mostra i Risultati"</p>
- <input type="button" onclick="location.href='result.php'" value="Mostra i Risultati"/>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement