Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (isset($_POST['email']) && ($emailQuery->rowCount() === 0) ) {
- //zdefiniowanie zmiennej $email
- $email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL);
- //if email is not correct syntax
- if (empty($email)) {
- //nie powiodlo sie echo $_POST['email']. "<br/>" .$email;
- $_SESSION['given_email'] = $_POST['email'];
- header('Location: index.php');
- } else {
- //poprawny adres echo $_POST['email']. "<br/>" .$email;
- // input into DB
- $query = $db->prepare('INSERT INTO users VALUES (NULL, :email)');
- $query->bindValue(':email', $email, PDO::PARAM_STR);
- $query->execute();
- }
- } else {
- header('Location: index.php');
- exit();
- }
Advertisement
Add Comment
Please, Sign In to add comment