Java
  Home arrow Java arrow Interacting with PHP for Server-side Data ...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

Interacting with PHP for Server-side Data Validation with AJAX
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 13
    2006-07-25

    Table of Contents:
  • Interacting with PHP for Server-side Data Validation with AJAX
  • Validating data on the server: building an input checking PHP class
  • Extending the functionality of the checking class: defining some additional methods
  • Assembling the pieces: completing the AJAX-driven checking application

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Interacting with PHP for Server-side Data Validation with AJAX


    (Page 1 of 4 )

    Looking for new and creative ways to empower your AJAX-driven Web applications? Then you’ve landed at the right place. Welcome to the final part of the series “Server-side Data Validation with AJAX.” In three tutorials, this series demonstrates how to build a simple form checking system which uses AJAX to performing server-side validation on the data supplied by users.

    Introduction

    For those of you new to the topics discussed over the course of this series, let me put you quickly in the right context: my initial purpose was to build a quite simple form validation mechanism. It would combine the quick responsiveness of JavaScript for alerting users about what data is considered invalid, and the reliability of a server-side scripting language (in this case, PHP), in order to execute several input-checking routines.

    Based on this schema, in the first article I constructed a sample online form that came in handy for implementing the basic structure of the validation system in question. Also, over the second tutorial, I went through the development of a group of JavaScript functions, focused on sending out HTTP requests via AJAX, in conjunction with controlling the proper flow of data validation.

    The complete client-side source code of this AJAX application has been developed already. You also know each time a user enters data in a particular form field because this input is submitted to the server in the background. So the only programming block that remains to be built is the one related to executing server validation on the data itself.

    In this concluding part, I'll write a PHP class that will be responsible for checking the validity of the data submitted with AJAX, in this way completing the entire application. Thus, let's waste no more time in preliminaries and see how the PHP class that I mentioned before will be properly coded.

    More Java Articles
    More By Alejandro Gervasio


       · Over the course of this final tutorial, you'll learn how to use a set of PHP...
       · A very good article - thank you. I get a parse error in the php-script :Parse...
       · Hello Andreas,Thank you for your kind comments on this article. Now, with...
       · I'm running PHP5 and I'm seeing the same error. Might be worth another look at...
       · Thank you for letting me know about your problem. I agree with you that it's...
       · I'm on php-5.1.6.Exactly the same error, whether via web server or directly.This...
       · class formValidator{public function __construct()...
       · With this (thanks to Lee Babin "Beginning Ajax with PHP" ,p.17)and minor changes...
       · Hello Monty,I'm glad to hear that now this application is finally working for...
       · I'm confused as there seems to be a file missing. I get an error "data_validator.php...
       · Thanks for the comments on my AJAX article. Concerning your question, you only need...
     

    JAVA ARTICLES

    - Deploying Multiple Java Applets as One
    - Deploying Java Applets
    - Understanding Deployment Frameworks
    - Database Programming in Java Using JDBC
    - Extension Interfaces and SAX
    - Entities, Handlers and SAX
    - Advanced SAX
    - Conversions and Java Print Streams
    - Formatters and Java Print Streams
    - Java Print Streams
    - Wildcards, Arrays, and Generics in Java
    - Wildcards and Generic Methods in Java
    - Finishing the Project: Java Web Development ...
    - Generics and Limitations in Java
    - Getting Started with Java Web Development in...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek