Sunday, November 14, 2010

PHP is a powerful tool for making dynamic and interactive Web pages.
PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.

PHP - What is it?

Taken directly from PHP's home, PHP.net, "PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly."
This is generally a good definition of PHP. However, it does contain a lot of terms you may not be used to. Another way to think of PHP is a powerful, behind the scenes scripting language that your visitors won't see!
When someone visits your PHP webpage, your web server processes the PHP code. It then sees which parts it needs to show to visitors(content and pictures) and hides the other stuff(file operations, math calculations, etc.) then translates your PHP into HTML. After the translation into HTML, it sends the webpage to your visitor's web browser.

PHP - What's it do?

It is also helpful to think of PHP in terms of what it can do for you. PHP will allow you to:
  • Reduce the time to create large websites.
  • Create a customized user experience for visitors based on information that you have gathered from them.
  • Open up thousands of possibilities for online tools. Check out PHP - HotScripts for examples of the great things that are possible with PHP.
  • Allow creation of shopping carts for e-commerce websites.

What You Should Know

Before starting this tutorial it is important that you have a basic understanding and experience in the following:
  • HTML - Know the syntax and especially HTML Forms.
  • Basic programming knowledge - This isn't required, but if you have any traditional programming experience it will make learning PHP a great deal easier.

Input Fields

Input fields are the simplest forms to grasp. As mentioned in the Forms Tutorial, just be sure to place the name attribute within the tags and specify a name for the field. Also be aware that for our form's action we have placed the $PHP_SELF super global to send our form to itself. We will be integrating more PHP code into our form as we continue on so be sure to save the file with a .php extension.

Code:



Personal INFO




First Name:name="Fname">:

Last Name:name="Lname">:

Radios and Checkboxes

The catch with radio buttons lies with the value attribute. The text you place under the value attribute will be displayed by the browser when the variable is called with PHP.
Check boxes require the use of an array. PHP will automatically place the checked boxes into an array if you place [] brackets at the end of each name.

Code:

...
Gender::

Male::

Female::

Please choose type of residence::

Steak::

Pizza::

Chicken::

Textareas

In reality, textareas are oversized input fields. Treat them the same way, just be aware of the wrap attribute and how each type of wrap will turn out. PHP relys on this attribute to display the textarea.

Code:

...
:

Drop Down Lists & Selection Lists

These two forms act very similar to the already discussed radio and checkbox selections. To name a selection form, place the name attribute within the select tags at the beginning of the form, and then place the appropriate value to fit each option.

Code:

...
Select a Level of Education:

:

Select your favorite time of day::

:
Be sure to check through your code to double check for bugs or errors especially look at each name attribute to be sure your names are all correct. As far as names go, you can copy the ones shown or simply make up your own, just be sure you remember what they are. Your form should be similar to the one shown here.

courtesy of http://www.tizag.com




Wednesday, January 6, 2010

About Me

Hai, I am Induwara Jayampathi from Sri Lanka.I am a computer programmer.I use to work with Java,PHP,ASP.net,c++,c#,vb6,vb5 ....I would like to share my experience with a cute programming language that I leaned recently with my new business.Currently I am holding a small it solution providing company,and I use to design web pages for out side companies.And the best html supprting programming language that works correctly on any os (platform) is php.