Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "pridedri_news";
- $password = "BBIT/7949/1/1630";
- $database = "pridedri_NEWSLETTER";
- try {
- $conn = new PDO("mysql:host=$servername;dbname=$database", $username, $password);
- // set the PDO error mode to exception
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $sql = $conn->prepare("INSERT INTO subscribers (email) VALUES (:email)");
- $sql->bindParam(':email', $_POST["email"]);
- // even exec() returnes true or false!!!!
- if($conn->exec($sql)) {
- echo "Request sent successfully";
- }
- } catch(PDOException $e) {
- echo "Connection failed: " . $e->getMessage();
- }
- //$conn = null;
- ?>
- <Doctype! html>
- <body>
- <a href="http://pridedrivetours.co.ke/">Back</>
- </body>
- </html>
Add Comment
Please, Sign In to add comment