Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(empty($_POST['invia'])){
- echo"<FORM ACTION='".$_SERVER['PHP_SELF']."'METHOD='POST'>";
- echo "<p><center>medico_registrazione";
- echo"<fieldset>";
- echo"<legend>registrazione</legend>";
- echo"user:<br>";
- echo"<input type='text' placeholder='' name='user' required><br>";
- echo"password:<br>";
- echo"<input type='text' placeholder='' name='password' required><br>";
- echo"<br><input type='submit' value='Invia'>";
- echo "</center>";
- echo "<br>";
- echo"<a href=homepage.html>home</a>";
- echo"</TABLE></FORM>";
- }
- $con=new mysqli("localhost","root","","esempio");
- if(mysqli_connect_errno()){
- echo("connesione_non_effetuata:".mysqli_connect_errno()."<BR>");
- exit();
- }
- $user=isset($_POST['user'])?$_POST['user']:'';
- $password=isset($_POST['password'])?$_POST['password']:'';
- $sql="INSERT INTO reg2(user,password)";
- $sql.="VALUES('".$user."','".$password."');";
- $ris=$con->query($sql) or die ("query_fallita");
- $con->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement