Post
Topic
Board Project Development
Re: PHP Coding question in regards to validat user input before passing it into mysq
by
TryNinja
on 10/12/2019, 23:43:27 UTC
this makes no sense

How are you validating if its a valid BTC address?
With your code. Your pastebin code has the function checkAddress($address) which I call before deciding to add the address to the table. If it returns true (address is valid), it calls addAddressToDb($address), adding it to the db (just create that function and put the mysqli code there, which you already have). And if it returns false (invalid), it just shows the error "Address is invalid" through the $error variable.

I just didn't copy the whole function here for obvious reasons (it has over 40 lines).

Also, please don't quote that huge reply for a 2 line answer. Either just reply normally or remove the big part of the quote, leaving only enough to point out what you are answering to.