Your Name:
Your Phone (10 digits):
Authentication Code:


[insert_php]

$dbHost = “localhost”;
$dbUsername = “adrofuel_af”;
$dbPassword = “Admin@@!@#”;
$dbName = “adrofuel_af”;
$db = new mysqli($dbHost, $dbUsername, $dbPassword, $dbName);
if ($db->connect_error) {
die(“Connection failed: ” . $db->connect_error);
}

if (isset($_POST[‘submit’])) {

$name = $_POST[‘names’];
$phone = $_POST[‘phone’];
$auth = $_POST[‘code’];

$flist = mysqli_query($db, “select codes from verify WHERE codes =’$auth'”);
$row = mysqli_num_rows($flist);
if($row == 1){
echo “The product has already been authenticated.”;
}
else{
$flist1 = mysqli_query($db, “select *from auth WHERE codes =’$auth'”);
$rows = mysqli_num_rows($flist1);
if($rows == 1){
$sqlinsert = “INSERT INTO `verify` (`id`, `codes`, `name`, `phone`) VALUES (NULL, ‘$auth’, ‘$name’, ‘$phone’)”;
if (!mysqli_query($db, $sqlinsert)) {
die(‘error while inserting’);
}
else{
echo “The product has been authenticated.”;
}
}
else{
echo “Invalid authentication.”;
}
}

}
[/insert_php]