Sponsored Links

WordPress and the “Add to foursquare” button

foursquare logo

I have been enjoying playing with foursquare lately, and wanted to add the “Add to foursquare” button to my Cape-hike.co.za [...]

HTML label syntax

HTML icon

Semantically correct coding pays off in so many ways. Here we see some advantages of correctly coding label controls in conjunction with input [...]

stripslashes() and magic_quotes

PHP logo

I had some shady characters hanging around my database at work yesterday…

So here’s the scenario:

I grab a heap of data in the form of comma delimited strings from and Interbase database on another server and then insert them as records in various MySQL tables on my reporting server. From there I do all kinds of [...]

Embedding a PDF in a web page

I recently did some work for a friend who wanted to display a PDF on a website. Rather than display a link to download the PDF, or open it in a separate browser window (or tab), I used the <embed> tag.

Simply use the embed tag to embed the pdf as an object in the page. [...]

Reloading a page with Javascript and your cache

I got caught out using Javascripts location.reload(true); recently. I have a web-page which is destined to be displayed in a public area on a large screen, which unfortunately has a LARGE, static background image (not my design – promise!). The page must reload fairly frequently, and I don’t want the background image disappearing while it [...]

PHP email validation using preg_match

PHP logo

After my last post about email validation using PHP’s eregi, a friend pointed out that it did not allow “+” signs to be entered…

A quick test to establish whether the “+” sign was legal in an email address returned a positive result. And a quick check here quickly established the ereg and eregi are now [...]

Create a Twitter Feed Widget for your blog or website

Twitter logo

I recently implemented this handy, easy-to-use, configurable Twitter feed Widget on www.clearer .co.za

Its real simple:

Log in to your Twitter account at www.twitter.com
Click on the Goodies link in the footer
Click on Widgets
Select the “MyWebsite” option on the left, and click on “Profile Widget“
Your Username should appear in the relevant input field – change it if you [...]

PHP email address validation

PHP logo

I discovered today that the PHP email validation in my User class was not allowing dashes…

A quick search on the internet came up with:

function is_valid_email($email)
{
$result = TRUE;
if (!eregi(“^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$”, $email))
{
$result = FALSE;
}
return $result;
}

Thanks http://snippets.dzone.com/posts/show/1504

ie6 No More!

Browser image

Considering the fact that upgrading to a “better browser” (even if you decide that this is simply IE7 or IE8) is so simple, free – and ultimately beneficial – is it not time for the community to start being more direct in their attempts to persuade users to [...]

Stop the Skype plugin from breaking your design

Skype logo

It took me a bit of searching to find this line of code to stop the Skype browser plug-in from automatically styling all the telephone numbers in your [...]