daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Nov 2nd, 2012 28 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3.         session_start();
  4.  
  5.         ini_set("display_errors", 1);
  6.         error_reporting(E_ALL);
  7.  
  8.         // Connecting to the MySQL server
  9.         $host=”localhost”;
  10.         $user_name=”root”;
  11.         $pwd=”xxx″;
  12.         $database_name=”webformdb”;
  13.  
  14.                 $db=mysql_connect($host, $user_name, $pwd) or die("Error connecting to the DB");
  15.                 mysql_select_db($database_name, $db) or die("Error connecting to the DB");
  16. // Storing form values into PHP variables
  17.  
  18. $na = $_POST["na"]; // Since method=”post” in the form
  19. $operator = $_POST["operator"];
  20. $mex = $_POST["mex"];
  21. $categorie = $_POST["categorie"];
  22. $storing = $_POST["storing"];
  23. $voorstel = $_POST["voorstel"];
  24. $extra = $_POST["extra"];
  25. $opvolging = $_POST["opvolging"];
  26. $contact = $_POST["contact"];
  27. $email = $_POST["email"];
  28. // Inserting these values into the MySQL table
  29. // we created above
  30. $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 . “‘);
  31. $result = mysql_query($query);
  32. // mysql_query() is a PHP function for executing
  33. // MySQL queries
  34. echo “<h1>Thank you for submitting your details!</h1>”;
  35. ?>
RAW Paste Data
Top