Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

POLL: PHP or JS for form validation.

Explorer ,
Jun 19, 2007 Jun 19, 2007
I'm just getting started with my first from the ground up app and still not sure which will serve me best. At this stage I'd rate my skill level in each language about the same, intermediate. Since both handle regex I can't decide if server-side or client-side is the way to go. Or is there a place and need for each? I'm interested in things like portability, compatibility, security, speed and anything else you think is an important factor.

Would like to hear from people that have made this decision and what benifits you feel you get from your choice.

Thanks in advance,
Mike D.
TOPICS
Server side applications
440
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 20, 2007 Jun 20, 2007
How about both?

Javascript client-side for field-by-field validation as the user is
completing the form.

PHP for server-side validation after the form is submitted to check for
malicious data injection.

http://www.xs4all.nl/~sbpoley/webmatters/formval.html

--
Regards

John Waller


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 20, 2007 Jun 20, 2007
On 19 Jun 2007 in macromedia.dreamweaver.appdev, mdonahue wrote:

> I'm just getting started with my first from the ground up app and
> still not sure which will serve me best. At this stage I'd rate my
> skill level in each language about the same, intermediate. Since
> both handle regex I can't decide if server-side or client-side is
> the way to go. Or is there a place and need for each? I'm interested
> in things like portability, compatibility, security, speed and
> anything else you think is an important factor.
>
> Would like to hear from people that have made this decision and what
> benifits you feel you get from your choice.

Poll?

You absolutely, positively have to do validation serverside. Javascript
validation can be avoided by the simple expedient of shutting off
javascript. (For example, spambots which abuse forms don't run
javascript.) Your only choice is to use some kind of serverside
validation. If you want to do clientside validation with javascript,
that's an added feature, but it's not necessary.

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/contact.php
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 21, 2007 Jun 21, 2007
LATEST
.oO(mdonahue)

>I'm just getting started with my first from the ground up app and still not
>sure which will serve me best. At this stage I'd rate my skill level in each
>language about the same, intermediate. Since both handle regex I can't decide
>if server-side or client-side is the way to go. Or is there a place and need
>for each?

Client-side (optional) for convenience,
server-side (mandatory!) for security.

Always start with the server-side validation. Then, if you want, add
some client-side functions.

Micha
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines