MySQL2CSV – simple online database dumps to CSV using PHP
I've often had the need to quickly and easily take a copy of a database table. Sometimes I am making a backup, other times I just want the data in CSV (Comma Separated Value) format so I can easily import it into another database or programme and so on. [include]adsense_horiz.php[/include] There are ways to do this with various things like web-based MySQL tools, or using the command line directly but sometimes nothing is quicker than a simple FTP client! So I put together this simple...
Read more
Comments(4)
23.08.2006
Getting started with PHP and XML parsing
Increasingly more and more sites and companies are offering XML data on their websites, such as the team at Audioscrobbler, and of course there has been a huge proliferation of blogs which all seem to offer their own RSS feeds - even I've got one! For those of us who are technically curious and like playing around with this kind of thing, there are all sorts of tools and things you can download to play with XML, but what particularly interests me is using a server-side language such as AS...
Read more
Comments(2)
20.04.2006
Validating XHTML containing borderless images as links
Often when an image is used as a link, we don't want to see a big chunky border around the image, which is there to indicate that it's a link (as well as changing colour to reflect the status - i.e. visited, active and so on). Back in the old HTML days we simply used the img tag's "border" attribute and set it to 0, hiding the border altogether. [include]adsense_horiz.php[/include] Hiding the image border in XHTML and CSS Because XHTML doesn't support the "bo...
Read more
Comments(1)
14.04.2006
Validating XHTML containing URLs that use ampersands
A very common method of passing data to a server is through the use of the query string. If you're not familar with what the query string is, you can read about about it at the Wikipedia article on query strings - all you need to know is that the query string can sometimes use the ampersand (&) character. Query strings are pretty harmless, but the problems start when we need to link to a page using the query string. Consider this example - you are link to a game demo download, and t...
Read more
Comments(0)
12.03.2006
Validating XHTML containing Javascript
If you have been converting some old HTML 4 (or maybe even older!) documents into the more modern XHTML 1 standard, you might have run into a problem with your Javascript when you have been validating your documents, i.e. the W3C validator (for example) is saying your document is not valid or there are warnings, and that you should try escaping some of your Javascript characters, such as "&" and "<". Obviously, if you did that, your javascript wouldn't then work! [include]adsense_ho...
Read more
Comments(0)
07.03.2006
Dealing with and preventing Referrer Spam
Recently I started to get a whole load of referrer spam (i.e. where someone has created some client to repeatably access your page with some spam url (usually porn) as the referring site in the hope that someone will stumble over it in your logs and click, or that it will increase their PageRank with Google from all the extra links). Its swamping the logs and hiding all of my real statistics, plus it turns out they've been comming back 2 or 3 times a day and spamming the site for a minute or...
Read more
Comments(0)
23.02.2006
CSS and conditional statements
I was playing around with a few ideas for a site redesign a while ago. I wanted a pretty sort of "heading" thing for the site, but decided that instead of using an image I'd be a good, accessibility-aware, standards-compliant guy and do it all with CSS. Fine. Stick in a couple of DIVs, set the background colours and you're done. At least I thought it would be easy - Firefox (and so I assume all/most Gecko based things) seems to whack on a huge extra margin at the bottom of the DIVs. ...
Read more
Comments(3)
23.02.2006
Generic cross-browser CSS hacks
Having read my page about conditional CSS statements to get around some browser quirks, Jamie Nicol sent me an email with a couple of very simple and elegant generic hacks you can use to give IE one set of CSS statements, and everything else another set of CSS statements. There are a lot of wierd and wonderful CSS hacks out there to get IE and other browsers to render pages how the author wanted them - what struck me about these two though was their simplicity and flexibility. [include]adse...
Read more
Comments(5)
23.02.2006