Resources from the web site of Well House Consultants on the subject of Newsletter Scripts. We provide
|Articles and tips on this subject||updated|
|1954||mod_rewrite for newcomers|
What is mod_rewrite?
It's an Apache httpd (web server) module that takes user's requests for pages and diverts them to a resource of a different name (and perhaps type). Why might we want to do this? See previous article for some reasons and alternatives
Here's a simple example of a rewrite rule:
|3179||Oops - I typed ci not vi, and have lost my file ...|
Sitting writing late at night, I occasionally misspoll something; no great problem - I can go back and correct it, or if I fail to do so occasionally my kind reader will work out whaT I mean and forgive. But occasionally, when I'm typing in commands at the command line, one character can cause a big ...
|2360||Error Handling in Lua with assert and pcall|
When a function fails in lua, you'll often find that it return a nil value that you can check, or it returns two values, the second of which is an error status / message that tells you what went wrong.
Here's an example:
value = tonumber(stuff)
if value == nil then
The simplest ideas are often the best ... and the simple idea of having a picture that automatically changes from time to time on your web page helps keep your customer's interest up when he returns to your site. You're seeing a picture of our dog Gypsy to the right of this block of text, but I don't ...
|2433||Controlling, supressing, enabling PHP error messages|
Q: "How can I suppress the PHP error messages?"
Q: "I get no error messages - how can I tell what is going wrong in my PHP"
Q: "Can I replace the PHP error messages with my own"
However PHP is configured, there is no satisfying everyone ... and it's a mystery to many people who install PHP code as to ...
|2046||Finding variations on a surname|
Here's a little demonstration of how you can use PHP to look for a 'similar word' - in this case, from a file of surnames. Have I done all the hard work? No - I crawled for some surnames to add to my demonstration file, and I used PHP's built in functions to do the hard work!
Run Demonstration ...
|2259||Grouping rows for a summary report - MySQL and PHP|
It's quite quick and easy to write a loop that goes through a mysql result set and displays the content on an HTML page (but remember security of data, size of resulting HTML page, and the need to consider special characters such as <). But what if you want a shorter report, grouping records together ...
|2145||Using the internet to remotely check for power failure at home (PHP)|
Do you have freezers and other electrical equipment at home and worry about whether they'll be all right while you're away on holiday? Do you have a broadband connection with a rarely changing IP address, and a web site that you host with a web space provider? Then you'll be able to set up a "heartbeat" ...
|1001||.pdf files - upload via PHP, store in MySQL, retrieve|
There's a common requirement to manage binary data - upload from a user, store, bring back in a web page. And where you have a substantial number of pieces of data - a lot of .pdf documents, .jpg or .gif images, or even Word documents, you'll wish to store them in a database with the potential for keyword ...
|1813||Ajax - going Asyncronous and what it means|
This is the second part of an "easy Ajax" series - for the first installment [link here].
|1743||First class functions in Lua lead to powerful OO facilities|
"In Lua, function names are first class variables." Ok - so what does that mean?
At the most direct / simplest, it means that a function can be stored in a variable - so that you can write
print ("does the real work!")
action = oik
|1665||Factory method example - Perl|
Utility methods (factorys) are often used to create objects which may be of any of one of a series of different classes, depending on the data passed in. Have a look at this Perl program which reads in data from a log file and creates a list of web site visit objects:
|1601||Replacing the last comma with an and|
If I have a list, I'm likely to want to present it comma separated for the most part, but with the word "and" between the last two elements.
"Cambridge, the M11, the M25, the M4, the A361 and Melksham" for example.
Lists or arrays can be joined in almost any language with a function called join or ...
|1505||Script to present commonly used images - PHP|
"What are the most popular pages in your picture library, and where are they used from?" An interesting question and I could analyze raw web logs to find out the answers. However, most of our images are managed by a script that retains extra information such as an image title, and uses are logged ... ...
|1487||Efficient PHP applications - framework and example|
There are many elements to your on line application - there's the "look" (1), the "feel" (2), the algorithms behind it (3), and the way the whole thing is bolted together (4).
1. The look may be shared across all the pages of your web site.
2. The feel you choose to use may be shared across all your ...
|1387||Error logging to file not browser in PHP|
When you first install PHP on your web server, any errors and warnings in you code are flagged up in the browser window. And that's ideal for development purposes - any problems are quickly indicated to you, with pointers to where the issue lies.
But when you go live, there's a different story, Of ...
|1321||Resetting session based tests in PHP|
I was writing and testing a PHP session based application - one in which a series of pages are linked together to make up a complete system - yesterday. And as ever with testing, bugs were found in the code and other things had to be added that meant it needed to be changed.
But it's rather different ...
|1217||What are factory and singleton classes?|
Do you find some of the OO terminolgy baffling? Once you've learnt about constructors and methods, inheritance, overloading and polymorphism and statics, you might think you're there. Then someone mentions a "factory class" or a "singleton" ...
Fear not - factory and singleton classes are posh names ...
|1123||mysqldump and mysqlrestore|
It is vital that you back up your data ... and if you hold your data in a MySQL database, then the mysqldump utility will do the job admirably for you.
It is equally vital that you can restore the data from backup if (heaven forbid) you need to do so ... and yet there is not a mysqlrestore utility.
|1066||Final, Finally and Finalize - three special words in Java|
A final method or variable is one that can't be overridden - you can define a method as final within a class to ensure that any extensions to the class don't replace it.
If you add a finally block onto the end of a try / catch exception handler, you're defining a block of code that will be run if the ...
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule
Well House Consultants specialise in training courses in
. We run
throughout the UK (and beyond for longer courses), and
at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if you live in a different
country or continent to us
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre. Also
available is the Opentalk
Forum for discussion of technical questions.