Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST[1]) && isset($_POST[2]) && isset($_POST[3]) && isset($_POST[4])) {
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "database";
- $conn = new mysqli($servername, $username, $password, $dbname);
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT eMail FROM dero";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- // output data of each row
- while($row = $result->fetch_assoc()) {
- //echo "id: " . $row["eMail"];
- if ($row["eMail"] == $_POST[2]) {
- echo '<script>
- document.getElementById("r_passw_error").innerHTML="↻ un account con questa mail esiste gia";
- $("#r_passw").blur (function (e){document.getElementById("r_passw_error").innerHTML=""});
- </script>';
- } else {
- $query = "INSERT INTO dero (user, eMail, Password) VALUES ('$_POST[1]','$_POST[2]','$_POST[3]')";
- $result = mysqli_query($conn, $query);
- if (!$result) {
- die("errore nella qery $query:");}
- echo '<p style ="color: red;">tutto funziona per il meglio</p>';
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement