PHP Files on this site - Dwyne (Dwine) Genealogy & Personal Site
🏠Home 👪Gen Back Top

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).

  1. Definitions
    1. PHP (Hypertext Preprocessor), it is "server side" (remote, what your connected to. google.com).
      1. PHP is primarily a scripting language, that can interact with a server, databases etc it can also generate HTML code.
      2. PHP is executed on the server, the resulting(if any) HTML is sent to the client's browser.

    2. HTML (Hyper Text Markup Language), it is "client side" (this is your system your browser).
      1. HTML is a text mark up language that determines the structure and layout of web pages.
      2. HTML is executed on users(your) web browser.
      3. HTML is static, PHP, Javascript and others interact to provide interactive content if required.
  2. File Types/Extensions
    1. .htm or .html files contain html code and may also contain PHP or JS as scripts
    2. .php files only contain PHP but may output HTM
  3. The Problem
    1. Local web browser, WeBuilders provided PHP and the servers (Dreamhost) execute/act differently
    2. PHP code in  file.PHP - online browser OK | in editor(IDE) OK | local file browser NO
    3. PHP code in file.HTM - online browser NO | in editor(IDE) NO | local file browser NO
  4. The Solution
    1. If there is any php always use the extension .php
    2. Occasionally you may have to rename your source to .htm to use a debugger tools etc.
    3. Be wary of any reformatting tidy tools, some have a nasty habit of modifing your code.