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');
?>
Written by Wayne Roddy
Related protips
1 Response
Sanitize and bind
http://www.php.net/manual/en/mysqli.quickstart.prepared-statements.php
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#