Now that we know how to mark up some content using email.
Let's see how we can use P P and e-mail together to create dynamic content as we just learned.
H t.
Email is a language used to tell a browser how to display a document.
It is not a programming language.
HDMI is sent from the server and is interpreted by the Web browser which is sometimes referred to as
a client.
P HP is a programming language and can be used to create manipulate and output data P2P code runs on
the web server and the results of running a p-h prescript are sent to the browser.
The browser doesn't know that it's HP code that has sent it some data it just receives whatever text
P HP has outputted this text could of course contain sdm al but it's important to remember that no p
p code goes to the browser.
H to them all on its own is fine.
If all you have is some static content that you want to display in a web browser.
However if you want a dynamic website.
For example a blog with new and updated articles are an e-commerce site with dynamic product data and
so on that has content that changes after magically.
Then you need to use a mixture of X to AML and pay HP for example.
As we saw earlier the airco statement in P HP is used to write out text to the browser so you could
use p p like this to write some astm Out to the browser.
Remember that the PSP code here will run on the server and will send the output from this code to the
browser.
If we look at this script in the browser we see some extra yamal.
If we view the source we see what the various echo statements in the P HP have written out.
It's all on one line because we didn't explicitly insert any line breaks.
The browser doesn't care about this.
It renders the 8 p.m. hour the same way regardless.
We'll see more on this later on.
Note that the pate's piece script is called indexed at p s p a script file needs to have the dot P.
H.
P extension so that the server knows to pass it far p s p code.
Also note that as we saw earlier a file called indexed.
Tier mail is served after Mattingly.
If no file is specified in the address the same is true for files called indexed up p HP.
If we remove the file name then we still get the contents of index dumpy HP.
Now although you can do this writing out here email using strings like this.
It's rather inefficient to do so and can be very difficult to maintain.
Plus it looks messy.
It's much easier to keep it to email and p p separate wherever you can.
So far with P HP we've been working with scripts that just contain p HP code.
We start our p p scripts with the p p opening tack here.
If you have a file that just has P S P in it then you only need the opening tag like this.
There's also a closing tag in Pilates P2 which we use when we're mixing P 8 p and htl mouth together.
For example let's start with this page of s t am owl fun now.
This is just eight term owl.
But note that the file name is indexed up p HP.
We need the dot p p file name suffix.
So the web server now was to run this p HP code before it sends it to the browser.
Let's insert some p-h P code here wrapping the p p code in the p p opening and closing tax.
If we look at this in the browser we get the result of what came from P H P.
If we view the source there's the simple text that came from the HP eco statement.
Before the web server sends this file to the browser it executes this cold and replaces it with the
results including the opening and closing tax.
So in this case the browser just gets the string Dave instead of all this let's look at another example.
Let's add some p HP at the top that are signs of value to a variable.
Note that this code doesn't output anything here.
In other words there's no echo statement.
Then lower down in the cold.
Let's print out the value of that variable
like that in the browser we get the result.
And again the p h p code has gone including the part at the top that didn't output anything.
One more thing I want to mention is the P HP shot open tag.
You might see this mentioned are used in other people's code.
Basically it's a shorter version of the opening tag.
Its usage is discouraged though as it has to be explicitly enabled and doesn't really offer any advantages.
Apart from slightly more concise p s p code so I don't recommend you use it.
There is however a sharp tag that you can use.
If all you're doing inside some p-h Peter because he's using airco then you can safely change it to
use the schadt école tag.
This will print out whatever you put between the tax.
And in the browser nothing has changed.
So if you prefer you can safely use this schadt ECHO tag to eke out a value.