Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. <?php
  2. require_once('connect.php');
  3. if(isset($_POST['submit'])){
  4. $login = $_POST['login'];
  5. $name = $_POST['name'];
  6. $surname = $_POST['surname'];
  7. $password = $_POST['password'];
  8. $gender = $_POST['gender'];
  9. $email = $_POST['email'];
  10. if($connect->connect_error){
  11. die("Connection failed: ".$connect->connect_errno);
  12. } else {
  13. $connect->query("INSERT INTO `my_users`(`Imie`, `Nazwisko`, `login`, `password`, `Gender`, `email`) VALUES ('$name','$surname','$login','$password','$gender','$email')");
  14. }
  15. echo "User ".$login." added succesfully";
  16. echo '<form method="post">';
  17. echo '<input type="submit" name="back" value="Add another user">';
  18. echo '</form>';
  19. if (isset($_POST['back'])){
  20. header("Location: formularz.html");
  21. }
  22. } else {
  23. header("Location: formularz.html");
  24. }
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement