Web Development with PHP and MySQL

Dynamic, database-driven small business web sites done right.    

 

Web Content Management System CMS driven by PHP and MySQL

The Virtual Sandbox web content management system, powered by PHP and MySQL™, is ideal for web site owners who want to be able to make changes to the text content of their web site using web based data entry forms. The main web page layout and design can be altered to meet your needs. This system uses server resident Open Source software applications including MySQL™ database tables and PHP scripting language.

Dynamic web pages are created "on the fly" when users click on a link. Web page data is compressed by PHP before being sent to the web browser, resulting in excellent delivery speed when coupled with comparatively bug-free Linux based web servers running Apache, PHP, and MySQL™. Additional databases can be easily added to your site. To get a rough idea of what the data entry forms in your web site's administrative hub will look like, test drive the form generator.

Optionally, site owners can make changes to the text content of any web page, or easily add new sections to the web site. An Administrative Hub, located in a password protected directory on the site, includes a number of utilities for data entry. Page content includes hidden META tags used by most search engines when indexing your web site. Proper use of META tags and page titles will greatly enhance your search engine ranking. Page content may contain HTML markup or plain text without HTML markup (a PHP script determines how to render the content).

A dynamic Site Map automatically indexes new pages added to the site. The Site Map is auto-generated based on whether a user is logged in (or not) and optionally includes 200-300 characters of content from each page in order to enhance SEO. In some instances, Google has keyed in on the Site Map page as a primary page on the site, returning that link in the user search results.

An optional Site Search page utilizes MySQL™ Full-Text Search on the content and page heading to return the most logical match for terms greater than 3-4 characters. Limitations: the main database is searched, however content generated using "include files" that query different database tables are not part of the Full-Text search. Configuration of specific additional searches is optional / additional.

The default "Contact Us" form comes with a text based anti-spam measure which is more user friendly than graphical Captcha interfaces. User input is validated for a few of the more common spam posts, generating an error message instead of transmitting suspicious messages. Basic departmental routing of submitted messages is optionally configurable.

Nearly unlimited content can be added to the site, with the number of pages of limited only by aesthetics as regards auto-generated navigation links. The basic approach is to use Section Number and Page Numbers within a particular Section.

One of the users of this CMS has more than 500+ pages of content online: etnews.org

Flags or toggles for individual pages include the ability to: temporarily suppress (hide) pages; specify https:// in the complete URL that is usually auto-generated for side navigation links; specify the user must log in to see a particular page; specify a numeric user level below which certain pages will not be displayed to certain users; Google Sitemap attributes (priority, change frequency, date of last modification) and semi-automatic creation sitemap.xml; NOINDEX toggle.

An optional cron job configured using cPanel (provided by the web host) will export MySQL data each night, and delete from the server exports older than "X" number of days, and on Sunday email a copy of the export to the developer for off-site storage. Certain tables, such as the changelog are skipped (not backed up).

CMS MySQL Schema

CREATE TABLE IF NOT EXISTS `vs_content1b` (
  `id` smallint(5) NOT NULL auto_increment,
  `snum` smallint(5) unsigned NOT NULL default '0',
  `pnum` smallint(5) unsigned NOT NULL default '0',
  `link` varchar(255) NOT NULL default '',
  `heading` varchar(255) NOT NULL default '',
  `meta_title` varchar(255) NOT NULL default '',
  `meta_desc` text NOT NULL,
  `meta_key` text NOT NULL,
  `js_inc` varchar(255) NOT NULL default '',
  `css_inc` varchar(255) NOT NULL default '',
  `php_inc` varchar(255) NOT NULL default '',
  `body_arg` varchar(255) NOT NULL default '',
  `html_1` text NOT NULL,
  `html_2` text NOT NULL,
  `php_script` varchar(255) NOT NULL default '',
  `content` text NOT NULL,
  `td_left` enum('1','0') NOT NULL default '1',
  `td_left_inc` varchar(255) NOT NULL default '',
  `td_left_content` text NOT NULL,
  `td_right` enum('0','1') NOT NULL default '0',
  `td_right_inc` varchar(255) NOT NULL default '',
  `td_right_content` text NOT NULL,
  `eval_content` enum('0','1') NOT NULL default '0',
  `mli` enum('0','1') NOT NULL default '0',
  `ul` enum('0','1','2','3','4','5','6','7','8','9') NOT NULL default '0',
  `https` enum('0','1') NOT NULL default '0',
  `nav` enum('0','1') NOT NULL default '0',
  `hidden` enum('0','1') NOT NULL default '0',
  `deleted` enum('0','1') NOT NULL default '0',
  `spider` enum('1','0') NOT NULL default '1',
  `priority` enum('0.0','0.1','0.2','0.3','0.4','0.5','0.6','0.7','0.8','0.9','1.0') NOT NULL default '0.5',
  `changefreq` enum('always','daily','hourly','monthly','never','weekly','yearly') NOT NULL default 'monthly',
  `posted` datetime NOT NULL default '0000-00-00 00:00:00',
  `updated` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  PRIMARY KEY  (`id`),
  KEY `snum` (`snum`),
  KEY `pnum` (`pnum`),
  KEY `hidden` (`hidden`),
  KEY `mli` (`mli`),
  KEY `deleted` (`deleted`),
  KEY `ul` (`ul`),
  KEY `spider` (`spider`),
  KEY `https` (`https`),
  FULLTEXT KEY `search_index` (`heading`,`content`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

Field Definitions

  • id = auto-increment page ID field for use in navigation links, e.g. index.php?s=1
  • snum = content section number (the average website contains 5-6 sections)
  • pnum = content page number within the designated section (snum)
  • link = text appearing in navigation links
  • heading = page heading displayed in the HTML H1 tag
  • meta_title = optional text displayed using HTML TITLE tag (if empty, the page heading is displayed)
  • meta_desc = optional text displayed using HTML META DESCRIPTION tag
  • meta_key = optional text displayed using HTML META KEYWORDS tag
  • js_inc = optional Javascript include file (in addition to common.js)
  • css_inc = optional stylesheet (in addition to style.css)
  • php_inc = optional PHP include file processed in page header
  • body_arg = optional Javascript code displayed within the HTML BODY tag, e.g. onload(...)
  • html_1 = optional HTML page header or graphic #1
  • html_2 = optional HTML page header or graphic #2
  • php_script = optional PHP include file processed before or after the main content
  • content = main HTML page content
  • td_left = toggle the usage of optional left column (usually enabled for navigation links)
  • td_left_inc = optional PHP include file processed below navigation links
  • td_left_content = optional HTML content displayed below navigation links
  • td_right = toggle the usage of optional right / third column (often unused)
  • td_right_inc = optional PHP include file for right / third column
  • td_right_content = optional HTML content for right / third column
  • eval_content = toggle to process the content field using PHP's eval() function
  • mli = toggle whether or not users must be logged in to view page content
  • ul = user level required for display to registered / logged in users [0-9]
  • https = toggle whether or not navigation links are generated using http:// or https://
  • nav = toggle for special navigation options (unused)
  • hidden = toggle the record status as hidden (not displayed, work in progress, etc.)
  • deleted = toggle the record status as deleted (flag records as deleted, do not actually delete records)
  • spider = toggle whether to display META ROBOTS NOINDEX
  • priority = Google Sitemap value
  • changefreq = Google Sitemap value
  • posted = date posted
  • updated = timestamp with date/time of last update

A basic and flexible web content management system requiring PHP 4+ and MySQL 4+ recommended for use with Linux based web hosting and cPanel website interface.

 

 

Merchant Accounts & Credit Card Processing

web hosting