Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "****";
- $username = "****";
- $password = "****";
- try {
- $conn = new PDO("mysql:host=$servername;dbname=mel9826_pharma", $username, $password);
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- echo "Connected successfully";
- }
- catch(PDOException $e)
- {
- echo "Connection failed: " . $e->getMessage();
- }
- ?>
- <?php
- $surname = $_POST['surname'];
- $lastname = $_POST['lastname'];
- $age = $_POST['age'];
- $email = $_POST['email'];
- $zip = $_POST['zip'];
- $contact = $POST['contact'];
- {
- session_start();
- $digit1 = mt_rand(1,6);
- $digit2 = mt_rand(1,6);
- $math = "$digit1 + $digit2";
- $_SESSION['answer'] = $digit1 + $digit2;
- }
- if ($_SESSION['answer'] != $_POST['answer'] ) {
- $commentError = 'Please answer the math question.';
- $hasError = true;
- }
- if (isset($contact) && $contact=="no") echo "checked";
- if (isset($contact) && $contact=="yes") echo "checked";
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="pharma.css">
- <title>YesDoz!™</title>
- <nav id="menu">
- <ul>
- <li><a href="melcappell.com">Home</a></li>
- <li><a href="#">About</a></li>
- <li><a href="melcappell.com/projects">Projects</a></li>
- <li><a href="#">Contact</a></li>
- </ul>
- </nav>
- </head>
- <body>
- <div id="motto">
- <h1>Thank your for your interest in YesDoz!™. Someone will be in contact with you shortly!</h1>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement