NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
Home / News / Webmaster / Tips and Tricks

Tips and Tricks


The World of PHP

Introduction to PHP programming

By Catalin Bocanu, Web News Editor

17th of September 2007, 15:16 GMT

Adjust text size:


PHP Information Output by phpinfo Function
Enlarge picture
Server side scripting is a powerful tool in the development of the present web applications. There are many scripting languages used for server side programming. PHP (PHP Hypertext Preprocessor) is the most used scripting language in the world due to the simplicity of synthax, enhanced object oriented capabilities, constant development (current version used is PHP 5) and more. The PHP code is executed by the webserver (usually Apache webserver) and the output is sent to the web browser as HTML.

This way, on the client side (your site visitor), there is not need of any plugins in order to view the php script output. PHP can be embedded in HTML also, because the server will recognize the PHP code, which usually is delimited by special PHP tags.

The PHP files are ending in .php and they can contain HTML, javascript or flash scripts. PHP applications are compatible with many operating systems. For example, the next simple PHP script allows you to display information concerning current state of PHP on your web server:

CODE

PHP Information Script


This is a simple HTML text displayed directly by web browser



This is PHP information





If you want to see the output of this script, save
it as phpinfo.php (the file name is not important) using a text editor, then upload it to a webserver and call it in web browser. For example, in case of Windows users that have an Apache web server with PHP on their computer, they must type in the web browser address bar http://localhost/phpinfo.php, assuming that they have put the file phpinfo.php in the directory htdocs. There are some articles concerning the installation of PHP and Apache, in case you do not know how to install it on Windows.

As shown in the screenshot, you will see the text in three different colors. The text from line 7 is output by the server as simple HTML text (you can see in the web page source). The function phpinfo from line 11 allows you to view the general information regarding your PHP installation. If it is called without the argument INFO_GENERAL, it will display by default all information of your PHP installation (you can try to change the script to see the results). This simple example has an introductory scope, but PHP is more than that. With PHP you can offer your site a higher degree of interactivity for your users. You can develop interactive forms which can be used in an address book or guestbook for example. You can also create an image gallery in seconds, only by customizing an existing script, because there are many free PHP scripts that you can choose.

PHP can easily interact with databases or flat files and will help you store and manipulate information more efficiently by developing content management systems. In order to learn PHP in an efficient way it is recommended to begin with HTML and CSS first, because the functions from PHP are usually employed to output HTML content.

TAGS:

PHP Introduction | PHP Script | PHP Scripting Language | PHP Tutorial | PHP Application


Rating:
Good (3.7/5) 7 vote(s) so far    

Read by 976 user(s) | Add comment | Link to this article
Subscribe to news | Print article | Send to friend

© Copyright 2001-2008 Softpedia
Contact:

 

 

SEARCH THE NEWS ARCHIVE :




Today's News
| Yesterday's News | News Archive


MORE RELATED ARTICLES:


Install mod_perl for Apache 2

Create Loadable Modules for Apache on Windows

Secure Apache Server for Windows

Is Joomla! The Best CMS on the Planet?

How to Install phpMyAdmin on Windows

A Simple Javascript Example

Reduce Spam by Protecting Your Email Address Name

Adding a Search Engine Feature to a Website

User opinions:

No user comments yet.
Be the first to express your opinion using the form below!

Share your opinion:

Your Name:
Your Email Address:
(will not be used for commercial purposes)
Solve this to prove you're not a bot: =
Your review/opinion:

 






SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   ENTER NEWS SITE   |   ENGLISH BOARD   |   ROMANIAN FORUM