Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- ini_set("display_errors", 1);
- error_reporting(E_ALL);
- // Connecting to the MySQL server
- $host=”localhost”;
- $user_name=”root”;
- $pwd=”xxx″;
- $database_name=”webformdb”;
- $db=mysql_connect($host, $user_name, $pwd) or die("Error connecting to the DB");
- mysql_select_db($database_name, $db) or die("Error connecting to the DB");
- // Storing form values into PHP variables
- $na = $_POST["na"]; // Since method=”post” in the form
- $operator = $_POST["operator"];
- $mex = $_POST["mex"];
- $categorie = $_POST["categorie"];
- $storing = $_POST["storing"];
- $voorstel = $_POST["voorstel"];
- $extra = $_POST["extra"];
- $opvolging = $_POST["opvolging"];
- $contact = $_POST["contact"];
- $email = $_POST["email"];
- // Inserting these values into the MySQL table
- // we created above
- $query = “insert into webform (na, operator, mex, categorie, storing, voorstel, extra, opvolging, contact, email) values (’” . $na . “‘ , ‘” . $operator . “‘ , ‘” . $mex . “‘ , ” . $categorie . “‘ , ‘” . $storing . “‘ , ‘” . $voorstel . “‘ , ‘” . $extra . “‘ , ‘” . $opvolging . “‘ , ‘” . $contact . “‘ , ‘” . $email . “‘);
- $result = mysql_query($query);
- // mysql_query() is a PHP function for executing
- // MySQL queries
- echo “<h1>Thank you for submitting your details!</h1>”;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement