<?php
require('connect.php');
if (isset($_POST['email']) && isset($_POST['password'])) {
$email = mysql_fix_string($connection, $_POST['email']);
$password = mysql_fix_string($connection, $_POST['password']);
$query = "INSERT INTO users (email, password) VALUES ('$email', '$password')";
$result = mysqli_query($connection, $query) ;
}
function mysql_fix_string($conn, $string)
{
$string = stripslashes($string);
return $conn->real_escape_string($string);
}
?>
...
<form name="f1" method="post">
<p> <input type="email" name="email" placeholder="email" required>
<input type="password" placeholder="password" name="password"maxlength="10" >
<input type="password" placeholder="confirm password" name="confirm"maxlength="10" >
<br><p class="error" aria-live="polite"></p>
<br><input type="submit" value="REGISTRATION" name="submit" class="reg" ></p>
</form>