MaggsWeb:7

www.maggsweb.com

Archive for the ‘ PHP ’ Category

Code commenting can be a pain. If its your code then you know exactly what it does and why. If its someone else’s code – then all of a sudden they are invaluable. The Doc Block commenting style is a widely used standard for commenting accross all languages, and can also be used to generate code hints and automatic documentation if used properly.

The following guide to code-commenting is taken from: http://net.tutsplus.com/tutorials/php/object-oriented-php-for-beginners/

[More]

I hate compressing CSS files as they become totally unreadable for editing. I end up keeping 2 versions, compressed and uncompressed, etc.. But how about compressing all your CSS files into one file, ‘on-the-fly’. Now that has solved the problem.

[More]

Just a little script I wrote to work out the date of the first day of the week.
[More]

PHP Sessions…

June 8, 2010 | Comments | PHP

Using $_SESSIONS… Forgot the syntax… Here-ya-go.
[More]

SEO is becoming more and more important, and URL’s need to be more visible. Here’s a function for creating a ‘slug’ which I used as an add-on to a site, using the page title.
[More]

MIME Types

February 25, 2010 | Comments | PHP

A full(-ish) list of MIME Types that may come in usefull for upload validatiuon.
[More]

This value is generally set in the httpd.conf (server) file, which is generally not accessible to users on shared hosting packages. So, here are a few ways to get around this.
[More]

Sending email attachments

January 24, 2010 | Comments | PHP

An example of how to send Text & HTML email with an attachment.
[More]

Displaying the day-part of the date, followed by the month etc. just looks plain wrong and lazy – ’20 September 2009′. ’20th’ would look much nicer and can be achieved without too much hard work. A simple function…
[More]

MySQL Database backup

September 29, 2009 | Comments | MySQL, PHP

Backing up a MySQL database using PHP.
[More]