1.)
Quote:
|
what is the purpose of having a site built in php
|
Mainly, being able to interact with something else, and add logic to the operations made by the site.
Quote:
|
I've seen a few sites on the net that are built in php but it looks like they could have been done in html just as well.
|
Which does make 100% sense, as PHP (and jsp, asp.net, coldfusion, ruby on rails, python and literally hundreds of other server-side languages) are there to do something "under the cover".
They just generate a bunch of HTML given conditions the programmer gave them.
Nothing of this is required, as you could create static pages that could have the same look.
But the devil is in the details.
Imagine a shop. Overused example, I know, but accurate.
Let say you want to apply a 10% sale for everyone during december.
In a server side enabled site, with a DB, you do in the db:
Code:
update prices set retail=retail-(retail*0.1);
and every prices of your shop are reduced by 10 %.
In a static site, it means you have to compute and manually update possibly hundreds of pages.
Sure, the result would be the same, but the time invested at the beginning to have a database pays of later.
Another example.
You want to change the look of your product page.
In a server side enabled site, you have 1 page, that define the look, ad where the language inserts bits taken out of a database.
So, updating every articles page means modifying 1 page really.
Again, in a static site, you have to modify every static pages by hand.
2.)
This is done via a process known as "url rewriting". It means that you tell the web server that when a browsed tries to reach the url it has to serve the content of a specific file.
You have a documentation and examples there:
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
3.)
Could not say, I never touched to flash and never looked to neither.