Minggu, 01 November 2009

PHP Basics 2

What is PHP?

OK, the server is ready. The next question is the fact that what is PHP? PHP is a program installed on your web server software. PHP works on versions of the Apache Web server, Microsoft IIS, and other servers (in the case phptriad, web server used is Apache Web Server). PHP is easy to learn, (mosgoogle) you are using PHP with a way to insert PHP code into the HTML used to build your site. When a client (anyone on the web) to visit sites that contain this code, your server will execute. That's why you need to install your own server to test your PHP code locally. In this case, the server is not brain your browser. Browser functions to display only the work of the PC server to the client. The client does not require any special or additional to view your PHP code in action on the server for execution of PHP code you will be taken in the HTML code to the browser client. Said the clever, PHP is good because it does not spend resources on the server CPU.
PHP is a scripting language, just HTML. This means that the code does not need to be compiled before use. Code that we make will be processed as required. This differs from programming languages like C, VB or Delphi that needs to be compiled (meaning compiled in change from a text into machine language form that can be directly executed by a computer, typically the file extension is EXE). Consequently, PHP requires PHP server to execute PHP code is still in the form of text, while the program compiled the results in the form of executable files do not need another program to be executed.
Before you dig deeper, you need to know that there are sites called php.net. PHP is an open source language, and php.net is the central controller (imagine if no one coordination, will be very difficult development). Php.net has many reference materials on PHP and various tips that sent the programmers from around the world. PHP.net has a very good information and in-depth about PHP, but it would be very scary for beginners to jump in there. In addition there is material in advance. at the end of this tutorial we will discuss on how to use the php.net site.
OK, now we already know about PHP, PHP is able to make anything? this way, PHP is able to:

* Retrieving information from the web-based form and use it for various purposes (storing in the database, create pages based on content berkondisi form, send an e-mail, and others);
* Authentication and track visitors, which means that we can know that our site visitors prefer to see which pages;
* Serving a page vary depending on the browser usage or equipment (such as we can tell our site visitors pake IE or Firefox or PDA, and treated differently. Imagine if such a small screen PDA were given a standard web page that big?);
* Displays the entire page of our site using only a single layout. If the static pages, we must create a layout for one page;

Bottom of Form
But before we study the special use PHP, as usual, we need to start from the simple first. Beginning with how to create a block of PHP with the following simple script. Please write the below code (which is red) notepada pake only. Continue to save with the prothelon.php name. Do not forget when saving the file name box, name the file should be in quotes ( "prothelon.php") because if not so, then the extension will be a txt and the file name so prothelon.php.txt. This simple script will display the words "you're on a site Prothelon!" On your browser.
print ( "You are in Prothelon site!");
The words in parentheses is the text that will be displayed by the browser, while the rest is PHP code.
Tag Is the beginning and end of the script, while the works you have to be placed in the middle. how, already understand? OK.

2 komentar:

  1. wah alhamdulillah nemu tutor php disini,, thx,, kayaknya bakal sering2 maen nich,,

  2. punya script jadi g mas untuk web sekolah