Monday, May 21, 2007

» 002 - Writing a piece of code for Server testing

This blog has PERMANENTLY been moved to Dreamweaver PHP (http://www.dwphp.com)

In the previous part I explained you about how to install Appserv as our server which also supports PHP and MySQL. I believed that you my dear online friends could get through all the processes so easily...

Let's begin with the next lesson for today. After you have Appserv installed, you should notice a directory call "Appserv" which is located in c:\ (by default "c:\AppServ\"). Double click on it and find a folder named "www".

This is where our files for web sites will reside....At this level of directoty, you need not pay attention to other folders. What's necessary for us now is only "www".

In order to test if the server is running quite properly for our development, type in this piece of code in your preferred code editor:

< ?php

echo "Hello guys, finally this is my first time coding.";

?>

Note that "<" and "?php" on the first line should stick together; I'm not able to make them get together in Blogger."

Save it as "lesson01.php" in c:\AppServ\www\

Then open you web browser and type in the following URL:

http://localhost/lesson01.php

You will see the sentence that you just coded earlier on the screen which means that the server seems to work okay, at least for the "echo" command.....lol ("echo" in PHP is like saying "Print these words in the quotes onto the screen.)"

At this point, I guess you could notice how the physical file and URL are related....Think about it this way: to make it simple, I want to you to think that "WWW" folder is like "Main" folder for your website which contain "lesson01.php" and other files.....and in the URL "localhost" is like a "server name/domain name" for our local PHP development test. Recall tutorial no. 001 for more info.

I'd recommend that for some of my dear friends who are just new to PHP (without any knowledge of PHP at all) to grab a PHP book, or visit http://www.w3schools.com/php/default.asp just a couple of days to give you some ideas about PHP so that you won't get confused on what I will demostrate to you in the next few days if some hand codings are required.

I hope, again, that this tutorial doesn't confuse you and give you a big headache...Any comments will be appreciated for my improvement on writing skill!! Thanks


1 comment:

COLIN said...

I like your clear English. I can understand. I'm learnung from you. Please don't stop teaching - you're very good at it. I need you. I've completely digested 001 and 002 - so where is lesson 003 and all the following lessons?????