MaggsWeb:7

www.maggsweb.com

Archive for the ‘ PHP ’ Category

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]

This has got to be the most self-explanatory, most obvious, but coolest function ever!
[More]

I usually write my own vars out to the screen for debugging using ‘print_r($_SESSION)’,'print_r($_POST)’etc inside <pre> tags, but this is awesome! (a little too much even). It’s like phpinfo(), but for your webpage!
[More]

I have often looked at my sites on my mobile.  Some look good, others look really bad – usually down to some clever fancy-arse stuff that wouldn’t even work on a mobile.

So, I have finally found this article that reckons it is sussed.  I’m gonna try it out.
[More]

How do you style a search button?  They all look crap to me, and the default browser ones are all different.  So, my solution is to get rid of it.  Gone.  No button.    Heres how…

[More]

Where am I…

September 26, 2008 | Comments | PHP

string basename ( string $path [, string $suffix ] )

  1. PATH :: A path. On Windows, both slash (/) and backslash (\) are used as directory separator character. In other environments, it is the forward slash (/).
    suffix.
  2. SUFFIX :: If the filename ends in suffix this will also be cut off.

I use this a lot to distinguish which page I am on. Generally, I would match this to a db record to get page-specific info and settings from the database.
[More]