Web Programming

This part of my Web site is dedicated to articles and notes dealing with Web programming in general (those dealing with Delphi are located here).

When I started developing this Web site, I knew nearly nothing of HTML, PHP, Javascript and other Web related languages. Some notes I took are now available here.  Have fun :-)

The anatomy of this Web Site From inception, readability and simplicity have been the prime movers of this site. Each page consists of two files: a PHP file (say: mypage.php) that contains the PHP scripts that generate the HTML and Javascript code for the page header, the menus and the page footer, and an HTML file (mypage.html) whose content is "templated" as the content of the page separating logic from the content. PHPLIB templates are used to display content. The rest of the architecture follows the liquid css-table model.

Cascading Style Sheets

Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics (the look and formatting) of a document written in a markup language [Wikipedia]. It is the result of past efforts by the Internet community to separate design from content and it has been very successful at doing it.

Welcome to CSS Articles dealing with CSS.
Tips and Tricks for the Web This page contains various tips and tricks for web programming in general. Very often, you are faced with an unexpected problem. Printing background colors was the first. Preventing submitter bots from feeding spam into the form of a blog was the second.
Dynamic cascading style sheets However, CSS has some flaws, the most frustrating of which is that it does not have variable capability. This can be corrected using PHP: with PHP, you can design a CSS file with embedded PHP code. It works as long as the PHP variables it contains are initialized before the file is linked or if the file is included in the main PHP code and located in the <head> section of the page between <style> tags. In this article I explain how I could pass the values of PHP variable to a linked CSS file containing embedded PHP code.
CSS variables are on the horizon! For a long time, the use of variables in CSS was a desired web programmers capacity. Here they are on the horizon in the landscape of the CSS standard (still only a proposal). It will allow a large number of simplifications in the code and eliminate redundancies that plague CSS files.
Wide Content breaks my layout In exceptional circumstances, when a snippet of code is comprised of a long paragraph and when this snippet is contained in a DIV/CSS HTML "liquid" structure, my code highlighter breaks the layout of the page by overflowing the whole page to the right of the screen and generating a horizontal scroll bar. Using CSS like overflow:auto;, white-space: pre-wrap; and word-wrap: break-word; is no cure. A jQuery/CSS solution is presented that cures the problem but its causality is not known.
A PHP way to simulate CSS Variables Here, I describe a scheme using PHP to implement CSS variables. A pseudo-CSS file with the .php extension is used. It contains PHP code as well as standard CSS statements. The PHP code extracts values from a cookie and various CSS statements are set by PHP code that assign them user defined values. Its implementation is relatively simple and it prevents redundancies in the file.
Media and Style Sheets This page describes how to separate cascading style sheets used for printing from those being used for the screen thus getting rid of "Click here for a printer-friendly version" notices.


Javascript is a light-weight, object-oriented, interpreted , dynamic client-side scripting language known mainly because it is hosted by web browsers and can help turn a dull static web page into an engaging, interactive, and intelligent experience. JavaScript can be used to manipulate the very markup in the documents in which it is contained and it works in all major browsers, such as Internet Explorer, Firefox, Chrome, Opera, and Safari.

jQuery came out in January 2006. Its formal definition is « an open source Javascript library that simplifies the interactions between an HTML document, or more precisely the Document Object Model, and Javascript. » In other words, jQuery makes DHTML easy. Specifically, jQuery simplifies HTML document traversing and manipulation, browser event handling, DOM animation and cross-browser Javascript development. It is an encapsulation of the DOM.

Welcome to my jQuery page This is the Welcome page for Javascript in general and for jQuery in particular. Both the script language Javascript and its plug-in, jQuery, are briefly described. It lists several articles written on the subject.
Tooltips This article describes how the tooltips are implemented on this Web site. The browser-generated tooltips are described and a method of generating them with CSS-only was developed. This method tended to clip the tooltip when the link was next to an edge of the page so that a DHTML-based method was developed. This last method is now used throughout the site.
Study of jQuery Chili This article introduces jQuery Chili, a syntax highlighter plug-in for jQuery. It consists of an analysis of its coding which shows all the steps that the plug-in takes to transform plain code into highlighted code for programming languages such as Delphi, HTML, Javascript, CSS and PHP.
Problem with jQuery Chili printing with line-numbering "on" This page describes a problem that I have had printing pages comprised of snippets of codes highlighted by jQuery Chili with line-numbering "on". In this case, the printout is simply unreadable since the useful content extends far beyond the edge of the printed page and is clipped.


Configuring multi-sites under Apache and Wamp This article describes how I proceeded to host multi-sites under Apache and Wamp Server on my computer.
Validating email addresses This article provides some background of the internet protocols with particular emphasis on the SMTP protocol that is used to send mail. It results from the requirement for visitors to my blog leaving a comment to provide at least a valid email address. The result is an email address validator tool which validates but is short from verifying. The verification of the address requires probing ports 25 or 587 which is not welcome by servers (I came very close to being black-listed). I found an easy solution: to subscribe to an e-mail validator.

Questions or comments?
Last modified: October 28th 2014 19:00:23. []