Let's write some p-h P code in the cold.
Ed we'll create a new file and call it Hello.
Doug P. HP in this file on the first line will write a less than character question mark.
And then the word thp.
This is called the P HP opening tag.
Now explain what this is.
In a moment.
Next on a black line below will tap the word echo followed by a space a double code character the message
Hello world.
And finally another double quote character and a semicolon.
I'll explain this in more detail in a moment.
We'll save that file by pressing control.
Yes.
Then in a web browser world type local host followed by a slash and then the name of the file we just
created.
Hello old doppie HP.
When I press Enter We see the hello world message.
So what just happened.
First let's learn how websites work a web server is simply a computer that has a web server software
installed web server software is a program that delivers our servers files that make up websites.
Earlier we installed X amp which includes the Apache Web server every web server has an address.
This could be Google that can learn programming but academy Wikipedia does.
Argh.
And so on.
By default the address of the web server you have installed on your computer is local host.
When web server software is running it sits and waits for requests for files.
These requests now may come from web browsers a web browser is a program for accessing websites.
When you tap the address of a web server into your web browser it requests the site from the web server
the web server it receives the request and sends the requested file back.
P H P is a programming language.
We write code in p h.
P that we save in a file on the web server.
When a p HP file is requested the web server first executes the AP HP cold then the results of executing
that code as sent to the browser.
It's important to note that p HP runs on the web server it doesn't run in the browser the browser knows
nothing about P HP.
So in our hello world example.
First to be at this line which is called an opening.
P HP tag.
This just tells the web server that some p-h peak cold is going to follow.
Then we have the école construct that says that whatever follows should be printed out to the browser.
Following that we have a message that just says hello world.
This message is contained within quotes so that the echo statement knows where the message starts and
where it ends.
Finally we have a semicolon.
This marks the end of this instruction.
We'll see many more examples of P HP code like this as we progress.
So don't worry too much just yet.