security - PHP - Final input-validate -


I validate three types of input (string, email, url):

string -Valid:

  if ($ _POST ['string']! = "") {$ String = filter_var ($ _ POST ['string'], FILTER_SANITIZE_STRING); If ($ string! = "") {// valid} other {// not valid}} other {// blank}  

Email validation:

  if ($ _POST ['email']! = "") {$ Email = filter_var ($ _ POST ['email'], FILTER_SANITIZE_EMAIL); If (filter_var ($ email, FILTER_VALIDATE_EMAIL)) {// valid} other {// valid not} other {// blank}  

URL-validation:

  if ($ _POST ['url']! = "") {$ Url = filter_var ($ _ POST ['url'], FILTER_SANITIZE_URL); If (filter_var ($ url, FILTER_VALIDATE_URL)) {// valid} else {// not valid}} else {// blank}  

after checking this I use the PDO Am I ready to make a statement

Do you think it is quite safe or have I missed some points?

Hope for your reply, thanks and greetings!


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -