Post
Topic
Board Project Development
Re: PHP Coding question in regards to validat user input before passing it into mysq
by
retteDenTierpark
on 11/12/2019, 00:08:31 UTC
in this function the address variable is happy

and i dont understand your code

you not validating the input

or at least i cant figure out how you validate it and where

you just posted this

if (isset($_POST["address"])) {
    $address = $_POST["address"];
    if (checkAddress($address) {
        addAddressToDb($address);
    } else {
        $error = "Invalid address.";
    }
} else {
    $error = "Please input an address.";
}


where does it get validated and how does this go into my database if its valid




i posted the complete check address function but i see nowhere how you pass the input through it