Filed Under: Code Snippets

Validating a form submission

17 January 2009 No Comment

If you want to validate a form and you have to check if all variables are set you have to keep a few things in mind:

a) If you disable a input field so users can only see the content you will not be able to fetch the value via $_POST

disabled=”disabled” if you add this to a input field and you submit the form you won’t be able to fetch it via $_POST

Instead use readonly=”true”

b) Textareas are slightly different. You will first have to strip all slashes if you want to fetch the real value of it.







Like our posts? Then subscribe via Mail:

Email:  

Similar Posts:

Socialize:

delicious stumbleupon

Leave your response!

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.com.