A common - novice - misunderstanding about PHP is that it does something that replaces HTML. If you are putting PHP into your HTML page and it is just showing up there, not doing anything, read on.
In the past you have probably developed HTML pages. What you need to know is that PHP does not replace HTML. It works with HTML to produce content that can vary for reasons that you decide.
HTML is the language that each of the browsers - Firefox, Safari, Internet Explorer (IE) and all the others - receive to know how to display a page to the user. This is called "Client Side" code - code that the browser receives and processes to display a page. A html page will typically end in .htm or .html [e.g. index.htm or index.html].
PHP is a "Server Side" language meaning that it is processed on the server prior to anything being sent to the browser. PHP code, that does something, is NEVER sent to the browser. It performs a function on the server prior to sending HTML or text to the browser. A php page should always end in .php [e.g. index.php]. In some cases older versions of php ended with an extension containing the version number like php3, but unless you have an exceptional reason yours will not.
If your php code is just showing up on the page and not doing anything, usually, it is because the filename of your page is incorrect. In order for the php code to render the page must end in .php NOT .htm or .html
Saturday, November 24, 2007
First Post
Well, every blog has to have a first post so here is mine. I have to admit that my code is probably never going to be revolutionary however it will be practical. To those who are learning PHP for the first time then this will be somewhere to start.
I will assume that you know that PHP is a processing language used to produce all sorts of cools stuff on the web. In fact I would so if you can dream PHP can help you accomplish it.
Typically PHP runs in conjunction with a *nix (Linux) based server, Apache web server and MySQL database server. The versions and configurations of each of these can vary greatly but for the most part these are the main components of a typical setup.
If you have any questions about setting up your own server, or need some help in doing so, feel free to contact me.
I will assume that you know that PHP is a processing language used to produce all sorts of cools stuff on the web. In fact I would so if you can dream PHP can help you accomplish it.
Typically PHP runs in conjunction with a *nix (Linux) based server, Apache web server and MySQL database server. The versions and configurations of each of these can vary greatly but for the most part these are the main components of a typical setup.
If you have any questions about setting up your own server, or need some help in doing so, feel free to contact me.
Subscribe to:
Comments (Atom)