Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- </head>
- <body>
- <?php
- if ($_POST["submit"])
- {
- if(!$_POST['name'] || !$_POST['email'] || !$_POST['username'] || !$_POST['password'])
- {
- echo "Nie wypełniono wszystkich pól!";
- } else {
- $name = addslashes($_POST['name']);
- $email = addslashes($_POST['email']);
- $username = addslashes($_POST['username']);
- $password = addslashes($_POST['password']);
- $conn = @mysql_connect ('localhost' , 'root', '') or die ("Błąd podczas łączenia.");
- mysql_select_db('form') or die ("Nie można połączyć z bazą.");
- $query = "INSERT INTO users('name', 'email', 'username', 'password') VALUES ('$name', '$email', '$username', md5('$password'))";
- $exec = mysql_query ($query) or die (mysql_error());
- echo "<h3> Rejestracja przebiegła prawidłowo! Witaj " .$name. " </h3>";
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement