Collection of softwares, news, articles, commands, reports, blah, blah, blah
Search This Blog
Wednesday, February 29, 2012
Agile Toolkit - PHP Framework with jQuery
Agile Toolkit is a powerful web development framework. Inspired by GUI Applications development, PHP "View" Objects in Agile Toolkit work seamlessly with HTML and jQuery. You can focus on developing Business logic and User Interface logic in pure high-level PHP code.
Tuesday, February 28, 2012
How to disable directory browsing , APACHE
If you are on an RPM installation of Apache (which i dont really recommend) you will find the apache configuration file probably here:
/etc/httpd/conf/httpd.conf
If you are using apache from the source tar balls ( like real men ) probably you will find the configuration file here:
/usr/local/apache/conf/httpd.conf
Using an editor like vi , edit the httpd.conf file and scroll until you find a line like this:
Options All Indexes FollowSymLinks MultiViews
To disable directory browsing carefully remove the line that says: Indexes and leave the line like this:
Options All FollowSymLinks MultiViews
Restart your apache webserver and thats it
JavaScript Form Validation : quick and easy!
How to add JavaScript Form Validation quickly
First, download the JavaScript form validation script here.
The zip file contains the javascript file, examples.
The script has a catalog of almost all the common validation types built-in.
The idea is to create a set of “validation descriptors” associated with each element in a form. The “validation descriptor” is nothing but a string specifying the type of validation to be performed.
Each field in the form can have zero one or more validations. For example, you can have an input field that should not be empty, should be less than 25 chars and should be alpha-numeric.
In other words, in order to validate a field, you just associate a set of validation descriptors for each input field in the form.
Using the form validation script
- Include gen_validatorv4.js in your html file just before closing the HEAD tag
- Just after defining your form, create a Validator() object passing the name of the form
- Now, add the validations required
< script src = "gen_validatorv4.js" type = "text/javascript" > |
|
< form id = 'myform' action = "" > |
|
|
< script type = "text/javascript" > |
var frmvalidator = new Validator("myform"); |
//where myform is the name/id of your form |
frmvalidator.addValidation( "FirstName" , "req" , "Please enter your First Name" ); |
The format of the addValidation() function is:
frmvalidator.addValidation(Field Name, Validation Descriptor, Error String); |
See below for the complete list of validation descriptors. The third parameter ( Error string ) is optional.
You can add any number of validations to a field.
frmvalidator.addValidation( "FirstName" , "req" , "Please enter your First Name" ); |
frmvalidator.addValidation( "FirstName" , "maxlen=40" , |
"Max length for FirstName is 40" ); |