Minggu, 01 November 2009

PHP Basics 4

now we try to write our first code. Please copy the following code into a file (using notepad only), and write down what you want to display on the browser in between the quotes.

"Print" in the code below to display on the screen means web browser when you open the file:









Save the file with any name without spaces and ending with. Php (notepad users attention: when writing apitlah file name with quotation marks), and if you have installed the server on your own computer, you must save it in a special directory where the web root your server (if you use phptriad location is c: \ apache \ htdocs).
The next step is to open your first file in the browser. Type http://localhost/namafile.php to see your great work, and yes, you should see the words "you're on a site Prothelon" (do not use the file -> open, and do not forget to turn on your web server. For phptriad click phptriad -> start apache).
If you try the code on the internet web server, FTP your files to your web server root.
Come on, now try the first and make your code work. If it works, come back here and we're going to play again. (if not successful, just contact us).
Error Message
Fun is not it? Surely if successful, if not certain bete nih. Especially to see errors in the script. You very likely will get an error like this:
Parse error: parse error in http://localhost/namafile.php on line 12

This error message is very useful and you will meet many of these messages, error messages similar tuh same people who do not like it at us, continued to criticize his hobby, but if we use that criticism to improve, we can benefit. You'll get a message like that for every line of our code is wrong. For our needs, actually wrote we need to know is that there is a culprit in our code in line 12. The next step, of course, check our code. When this began to seem troublesome use notepad. Must count rows. Therefore try to use another editor, I myself like crimson editor. For our needs, we just need to know that something is wrong with our code in line 12, so let's look at the line soon they will be, and who knows may know the cause. I always start by looking at what my basic syntax is correct, for example if I had written; the end of the line, the closing tag, the parentheses?


Let us continue our code by adding some important part to the last page we had.
In the code that you write, please write a few lines again. As you can see, you can combine more than one PHP function in a tag. Comments in the code explain what each part:

















NOTE: phpinfo will produce a very long information about your PHP version. You do not need to memeahami all means, I just wanted to show you. Who knows one day need it.

7 komentar:

  1. WAH............. ENGLISH TUTORIAL NICH SOB.... PERTAMANYA JUGA SOB KAYAKNYA....

    BalasHapus
  2. sip nih
    belajr php ah dikit dikit

    BalasHapus
  3. Walau ngga terlalu ngerti sama PHP, Minimal Bisa Jadi Bahan Bacaan Bahasa Inggris nih mantab gan.... Thx

    BalasHapus
  4. Sip nich, ikutan belajar php juga yaaaa....

    BalasHapus
  5. info yg sangat ber mamfaat

    BalasHapus
  6. waaa pusing liatnyaa,,
    bukan bidangku mungkin yaa

    BalasHapus