Thursday, January 28, 2010

getElementById

Firefox doesnot recognize "name" attribute

This is to expose how Internet Explorer and Firefox browsers treat the getElementById method. This method takes the id of the field (normally the 'INPUT' field) as paramenter. If you give the id using id attribute it will work in both Internet explorer and Mozilla firefox. If you use 'name' attribute to give name to your input field/tag it won't be recognized by Firefox and your JavaScript won't work with getElementById.


Here is the example code: This will work in both IE and FireFox
Type something



In the above example i use a text filed and set its id property to 'YourName". I used a button and called a simple JavaScript function in it OnClick event to display the text in the textbox. I used the alert function to display the message box. This will work both in IE and Firefox. In the below example i set the name attribute to 'YourNameIE'. Note, i used 'name' attribute instead of 'id' attribute. That is the difference. This won't work in Firefox when you click the Click me button. That's it. So don't use name attribute in field naming.

This will work only in Internet Explorer
Type something

Tuesday, January 19, 2010

PHP Introduction - The birth

Welcome to PHP


Welcome to this free PHP tutorial blog. You have made the right decision by start learning PHP. PHP (Hyper Text Pre-Processor) is the open source server side scripting language. PHP is used to build rich and powerful web applications and database driven web sites. You can develop online shopping portals, forums, business websites, chat applications and much more with the help of PHP. Here is the brief history of birth and growth of PHP.

The history of PHP dates back to 1995, when an independent software development contractor named Rasmus Lerdorf developed a Perl/CGI script that enabled him to know how many visitors were reading his online resume. His script performed two taks; logging visitor information, and displaying the count of visitors to the web site. In those times such scripts were not available. Rasmus start receiving emails asking for the script. He started giving away his new tool, named Personal Home Page or PHP.

With his PHP gaining popularity Lerdorf began developing his PHP. Ongoing additions to the PHP toolset culminated in November 1997 with the release of PHP 2.0, or Personal Home Page - From Interpreter (PHP-FI). Programmers worldwide participated in developing PHP and adding new features to it.

In the year 1998 PHP version 3.0 was released. By then over 50000 users were using PHP to enhance their web pages. By then PHP abbreviation changed to Hypertext Preprocessor.

By 1999 more than a million people were using PHP. Two core developers, Zeev Suraski and Andi Gutmans, took the initiative to spearhead a complete rethinking of the way PHP operated, resulted in rewriting of the PHP parser from the scratch. The result of this work was the release of PHP version 4.0