Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Подключение к БД
- $dbh = new PDO('mysql:host=localhost;dbname=testing', 'root', 'root');
- if(!empty($_POST['name'] && $_POST['email'])) {
- $name = $_POST['name'];
- $email = $_POST['email'];
- $data = [
- 'name' => $name,
- 'email' => $email,
- 'subscription_status' => '1',
- ];
- $sql = "INSERT INTO users (name, email, subscription_status) VALUES (:name, :email, :subscription_status)";
- $stmt= $dbh->prepare($sql);
- $stmt->execute($data);
- header( 'Location: succes.php');
- }
Advertisement
Add Comment
Please, Sign In to add comment