array( 'Hostname' => 'localhost', //database ip 'Username' => 'contact_form', //database user name 'Password' => '525win', //database password 'Database' => 'contact_form', //database name ) ); } class DB_connect{ public function connect_db(){ $cont = mysqli_init(); mysqli_options($cont,MYSQLI_OPT_CONNECT_TIMEOUT, 30); mysqli_real_connect($cont,DB_Conf::$DB_Config['DbConfig']['Hostname'], DB_Conf::$DB_Config['DbConfig']['Username'], DB_Conf::$DB_Config['DbConfig']['Password'], DB_Conf::$DB_Config['DbConfig']['Database']); // echo @mysqli_ping($cont) ? 'true' : 'false'; return $cont; } public function disconnect_db($cont){ mysqli_close($cont); } } $name = ''; $visitor_email = ''; $user_message = ''; if(isset($_POST['submit'])) { $name = $_POST['name']; $visitor_email = $_POST['email']; $user_message = $_POST['message']; $cont=DB_connect::connect_db(); $query = mysqli_query($cont, "INSERT INTO `contact_form` (name, email, message) VALUES ('$name', '$visitor_email', '$user_message');"); DB_connect::disconnect_db($cont); //header('Location: thank-you.html'); } ?> Contact Andrei Chernyshenko

Contact me

If you would like to get in contact with me please full out the form below.








Quick Nav

  • Coming soon!