FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » General » HTML, Javascript, jQuery & AJAX » AJAX - PHP validation
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
AJAX - PHP validation [message #39114] Sun, 30 September 2007 06:38 Go to next message
esm2002 is currently offline  esm2002   United States
Messages: 339
Registered: May 2002
Location: Atlanta Georgia
Karma: 0
Senior Member
I have a page where I use AJAX to call a PHP file which validates a couple of fields in a form. I use onblur to call a JS function which is a AJAX call a PHP file which checks the field for validity.

I have read a little about using JS to validate client-side (folks say this is a thing to do) and PHP to validate server-side (folks say this is a must).

So where does AJAX fit into the validation of form data...???

I have read where JS is useless if the surfer has it turned off. But you cannot really use my site if JS is turned off.

Comments???



.


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Re: AJAX - PHP validation [message #166525 is a reply to message #39114] Sat, 07 January 2012 05:30 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
AJAX can be used to validate data interactively as users type. You still need to re-validate everything when the form is posted, as AJAX is JS based and can be deactivated and bots can post data without executing the JS.

Re: AJAX - PHP validation [message #166645 is a reply to message #39114] Sat, 04 February 2012 09:24 Go to previous message
NeXuS is currently offline  NeXuS
Messages: 121
Registered: July 2010
Location: South Korea
Karma: 5
Senior Member
Contributing Core Developer
What you can use AJAX for is:

  • local verification
  • remote verification

Local verification: you check things like "password1 == password2"
Remote verification: you call a script on the server (PHP,Perl,etc.) which tells you if a parameter is valid (e.g. usernamve available)

As already stated you will anyway to redo the checks server side.

[Updated on: Sat, 04 February 2012 09:25]

Report message to a moderator

  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: new window with out resize scrolling etc.. help please
Next Topic: Pre tags in posts
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Mar 28 08:48:10 GMT 2024

Total time taken to generate the page: 0.03654 seconds