Installing PHP
There are two ways to install PHP on windows platform available
for download at php.net. Either by using windows installer or
manual binary installations. In both cases, download the most
recent version of PHP from php.net .
Windows Installer
Using windows installer is the easiest way to install PHP but might not automatically install all the functions you might want use.
1. Download PHP 5.2.0 installer .
2. Select country mirror and follow the installation instructions.
Test PHP
The easiest way to test if php installation was successful is to create
php page and call phpinfo() function. To do this, simply
create file with any text editor such as notepad or
textpad and place this code
<? phpinfo();> and save it
under your web server root directory with the file extension php Eg: try.php. Open this file on your web
browser and it should display php information on your browser.
Basics of PHP
PHP stands for Hypertext Preprocessor. It's multi platform sever side script language. When php file is request by the browser, the browser does not
send the page back to the client browser instead its content is
interpreted & processed by the server.
PHP is also script language that you combine with HTML document if PHP installed on your server.
You can create php file using any text editor such as, textpad, notepad, simple text, BBEdit or any other similar editors.
All ways start your PHP script with tag<? or <?php and end the tag ?>
PHP Structure
The following are three different ways you might structure your php script file.
<?
//Php code here echo "hello World" ?>
or
<?php
//Php code here echo "hello World" php?>
or
<script language="php">
//Php code here echo "hello World" </script>
All 3 ways are valid ways to structure your php script
// is comment line for php which means that script will ignore that line completely and
echo or print
will write the quoted string "hello world" on your browser.
|