MaggsWeb:7

www.maggsweb.com

Archive for the ‘ PHP ’ Category

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]

I have been looking for a ‘simple’ tag cloud generator that will parse content from MySQL for ages and couldn’t find one. So I adapted – and heavily modified (reduced) – and CSS’d – the best one that I could find. It turned out nice and simple.
[More]

PHP Image UpLoader

October 18, 2007 | Comments | PHP

My image upload script. Loads of checks, not all used each time. Optional file-physical-size checks rely on ‘getimagesize’ working. Its long, but stick with it. It works.
[More]

Simple captcha

October 4, 2007 | Comments | PHP

Spam! Urrrgggh! Want a ‘simple’ way of stopping spam in form submissions? Have a go at this, written by myself and used on quite a number of sites. Its simple – and works without relying on third-party-providers.
[More]

Logging user activity

August 22, 2007 | Comments | PHP

Logging user activity is vital when there are multiple authors for a site. It also helps with debugging user activity when there is problems. You certainly don’t want to be putting this into a database, so the next best thing is a nice little text file.
I have used this to log user activity in a number of sites, as it can easily be added after development. In this example, $PAGE and $pageTitle are set in each page as they are used to determine menu selections, etc.. but these can easily be set manually.
[More]