Please, some clarifications:
Till now I used two steps validations (client/server) for some user inputs, for example – email (classic form submitting – by reloading the page).
If I use php-jquery ajax method – is it clever all the validation perform on server (because application already communicates with the server), or maybe keep some validations on the client side too.
Second, is there a better way for php mail validation than the following:
If(!filter_var($mail, FILTER_VALIDATE_EMAIL))...
And finally, is there any language, any framework, any… whatever (for web development) where all variables, once declared, are automatically available everywhere, on each page, on each file inside the project ?
Remember:
If you use Php/Ajax form handler you should validate the input at the very first submit from the user and than you send a response (202 or 0) based on the validation success.
For the email verification, after the users send all the data and the form is complete, you can send to him a token (via Email) that let him to “activate” the account
Something like http://www.myFakesite.com/activate.php?tkref=2423fuhr334hu (unique for every users of course)
Last the
FILTER_VALIDATE_EMAILit’s a great validator but it doesn’t check the DNS records