Softpedia
 

NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
Home > News > Webmaster > Tips and Tricks

September 17th, 2007, 15:16 GMT · By Catalin Bocanu

The World of PHP

SHARE:

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.

TELL US WHAT YOU THINK:

1,909 hits · Link to this article · Print article · Send to friend · Subscribe to news

MUST-READ 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

READER COMMENTS:



No user comments yet.
Be the first to express your opinion!
Copyright © 2001-2012 Softpedia. Contact/Tip us at

WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM