PHP (PHP: Hypertext Preprocessor) is a server side language (have the same function like ASP, ASP.NET, of JSP). For the first time PHP development began in 1994 when Rasmus Lerdorf made some set of perl script that he called as "Personal Home Page Tools" to maintain his `Personal Home Page`. In 1997 Zeev Suraski and Andi Gutmans, two Israeli developers rewrote the parser and formed the base of PHP3. The PHP3 was launch in June 1998 and Zend Engine was found in 1999.
PHP is a popular server side language on Linux but now we also use it on Unix, Windows and Macintosh. For the first time it was designed to run with Apache web server, but now we can run it using PWS (Personal Web Server), IIS (Internet Information Server) and Xitami.
Why we use PHP?
We use PHP to generate a dynamic HTML page. As you already know that HTML page is a static page that can only display a static information. For example you cannot display a page that show a timestamp but PHP can do it although you have to refresh the page anytime you want to see the new timestamp.
How PHP works?
- when user open a web page, the request was send to the web server.
- web server then search and execute the PHP script
- PHP script then produce the HTML code and send it back to the client browser
I will show you how to install PHP on Windows now.
- to install PHP on windows is very simple now. you can download and install a free web server software like XAMPP or WAMP here.
- install and follow the instruction.
- turn on your web server
- and you are ready now, just open your browser and type "http:\\localhost" that's all
Lets make our first PHP script. But first I want to show you the similar HTML script that produce the same page on your browser. First write this code to an editor like notepad/wordpad. Then save it as first.html for html and first.php for PHP. Then open your browser and open it. (I will explain about how to open it in other topic. But you can open XAMPP/WAMP web site to do this)
HTML:
PHP:
HTML:
PHP:
No comments:
Post a Comment