Note: If you are seeing ! ! No PHP - This page is non functional. you are probably in local/file mode.
How to handle/use/edit/create PHP files on this site > www.dwyne.net
www.dwyne.net is currently running on the ISP (Internet Hosting/Service Provider) Dreamhost.com. This is the server.
I use an editor/IDE (Integrated Development Environment)
WeBuilder(https://www.blumentals.net/) that provides a local PHP
server/enviroment.
The following refers to PHP contained in a webpage (yours.htm).
- Definitions
- PHP (Hypertext Preprocessor), it is "server side" (remote, what your connected to. google.com).
- PHP is primarily a scripting language, that can interact with a server, databases etc it can also generate HTML code.
- PHP is executed on the server, the resulting(if any) HTML is sent to the client's browser.
- HTML (Hyper Text Markup Language), it is "client side" (this is your system your browser).
- HTML is a text mark up language that determines the structure and layout of web pages.
- HTML is executed on users(your) web browser.
- HTML is static, PHP, Javascript and others interact to provide interactive content if required.
- File Types/Extensions
- .htm or .html files contain html code and may also contain PHP or JS as scripts
- .php files only contain PHP but may output HTM
- The Problem
- PHP and HTM code can be mixed in both file extensions.
- The Solution
- If there is any php always use the extension .php
- Occasionally you may have to rename your source to .htm to use a debugger tools etc.
- Be wary of any reformatting tools (tidy, PHP format, etc), some have a nasty habit of modifing your code.
Local web browser | WeBuilders provided PHP | Online servers (Dreamhost) |
PHP code in file.PHP NO | PHP code in file.PHP OK | PHP code in file.PHP OK |
PHP code in file.HTM NO | PHP code in file.HTM NO | PHP code in file.HTM NO |