very good discussion guys, thank you to everyone...
So, I have understood that I need the form tag even though I choose
not to support users with javascript off.
I've also understood that is a good practice guarantee access to
people with javascript off (about 5% now,
http://www.w3schools.com/browsers/browsers_stats.asp).
I "lost" the whole morning surfing the web trying to understand what
other people think about js on or off...
I usually check client-side for all of this stuff:
!@#$%^&*()+=[]\\\';,/{}|\":<>?~`.- _£
and then, if everything is fine, I send the data to php and I do just:
$_something = htmlentities($_POST['something']);
and then it's ready to be stored on the db.
Wasn't it enough?
Anyway It's useless to have a double check (client-side and server-
side), so, following your ideas I should do just a server side check
but it isn't as cool as AJAX...
Or maybe I could;
CLIENT-SIDE: check if the fields are filled up correctly (so who has
js on can find it usefull) and
SERVER-SIDE: check again all the fields and, above all, look for some
characters for security reasons.
What do you think?
Cheers,
Andrea