Advertisement
adventuretimeh

registrazione_dati(esempio).php

Jul 6th, 2022
776
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.92 KB | None
  1. <?php
  2. if(empty($_POST['invia'])){
  3. echo"<FORM ACTION='".$_SERVER['PHP_SELF']."'METHOD='POST'>";
  4. echo "<p><center>medico_registrazione";
  5. echo"<fieldset>";
  6. echo"<legend>registrazione</legend>";
  7. echo"user:<br>";
  8. echo"<input type='text' placeholder='' name='user' required><br>";
  9. echo"password:<br>";
  10. echo"<input type='text' placeholder='' name='password' required><br>";
  11. echo"<br><input type='submit' value='Invia'>";
  12. echo "</center>";
  13. echo "<br>";
  14. echo"<a href=homepage.html>home</a>";
  15. echo"</TABLE></FORM>";
  16. }
  17. $con=new mysqli("localhost","root","","esempio");
  18. if(mysqli_connect_errno()){
  19. echo("connesione_non_effetuata:".mysqli_connect_errno()."<BR>");
  20. exit();
  21. }
  22. $user=isset($_POST['user'])?$_POST['user']:'';
  23. $password=isset($_POST['password'])?$_POST['password']:'';
  24. $sql="INSERT INTO reg2(user,password)";
  25. $sql.="VALUES('".$user."','".$password."');";
  26. $ris=$con->query($sql) or die ("query_fallita");
  27. $con->close();
  28. ?>
Advertisement
RAW Paste Data Copied
Advertisement