The list of all PHP and Mysql posts

First step to write PHP code

The first step to develop PHP codes is to have the appropriate program to compile it.
Apache is PHP compiler , but instalation of Apache is a really difficult work for beginners.

Have this Word from ME :
The best way of doing a work is the easiest way.

The easiest way to begin php is WAMP. WAMP is a program that is involved Apache (php compiler) and PHP Myadmin - a page to create data bases ( "virtualy on your computer").

After instalation of WAMP your computer would be a server that you can put your PHP or HTML codes in the folder " /wamp/www " (or something look like this name). and your browser will show the page of the codes , if you type its address in the address bar.

You can download WAMP by a search on the internet.

After wamp instalation (run wamp from the start menu) you can see the wamp icon at right-bottom of the screen:



if you click on the wamp icon you can see controls for your server.



For example you can go directly to www folder (it contains the files that you write php and html codes).
Or you can stop some of the services. For example if you stop Apache , your php codes will not be compiled by your computer.

The web page files should be PHP or HTML.
PHP files have the suffix of  ".php" and you can write your codes by a simple text editor look like "NOTEPAD" .

For example put the following code in a php file.
code:
the date is
 <?php echo date('j F y');
echo"your name"; ?>


Now put this file in your /WWW folder.To show the result open your browser and type this address in the address bar:
http://localhost/file name.php
Localhost means that the file is done by the local server.
This code will show "the date" and "your name".
RESULT:

the date is 27 January 11your name

The order of "echo" is used to print a text or result on the screen.

4 comments: