You already know how to verify if the address is valid. If it is, insert it into the table (as you already know), if it doesn't, do something like this:
$error = "Invalid address.";
}
// and maybe in the html
<**php if ($error) { echo $error; } **>
// i changed ? to ** since cloudflare was blocking the code with the real php tag
An working example:
if (isset($_POST["address"])) {
$address = $_POST["address"];
if (checkAddress($address) {
addAddressToDb($address);
} else {
$error = "Invalid address.";
}
} else {
$error = "Please input an address.";
}
**>
<**php if (isset($error)) { echo $error; } **>