Last Updated: February 25, 2016
·
965
· dubrod

simple mysqli processor

<?php
$database_server = "localhost";
$database_user = "XXX";
$database_password = "XXX";
$dbase = "XXX";

$mysqli = new mysqli($database_server, $database_user, $database_password, $dbase);

/* check connection */
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}

$insert = "INSERT INTO `leads` (
    `email`,
    `phone`
    ) VALUES (
    '".$_POST[email]."',
    '".$_POST[phone]."'
    )";

$result = $mysqli->query($insert);

$mysqli->close();

header('Location: success.html');

?>

1 Response
Add your response