Monday, 25 January 2010 – | One Comment

The Smartphone has been growing fast, but in the last year or two it seems to be levelling out a little. Accelerometers, Digital Compasses, Assisted GPS, Bluetooth, Camera, Wi-Fi and Touch Screens are all familiar …

Read the full story »
Downloads

Things to download free, from posters and shortcut guides to white-papers and checklists

How To & Tutorials

These handy problem solving tips and advice should save you some time

Industry News

News and commentary from news in the technology industry

Safety & Security

Be safe and secure both online and offline, from securing your computer to safe online surfing.

Software

Explore recommended software applications from around the Internet

Home » Archive by Tags

Articles tagged with: Code

PHP: Establish Class for MySQL Connections
Tuesday, 18 November 2008 – | No Comment

Basic Class for creating a database connection
Class MySQLConnection
{
// ———————–
// variable initialisation
// ———————–
var $SERVER = “hostname”; // Server name
var $USER = “dbusername”; // Database username
var $PWD = “dbpassword”; // Database password
var $DBNAME = “dbname”; // Database …

PHP: Removing HTML Tags from Strings
Tuesday, 28 October 2008 – | 2 Comments

Using text fields on web based forms to obtain information from a website user can often lead to unexpected string inputs. A typical unexpected input might be a field that asks a user to submit a link …

PHP: Session Variables
Wednesday, 22 October 2008 – | No Comment

Session variables used to need registering however now they are more in line with _POST variables, so:
On the page to activate Session Handling use
session_start();
You can always check the Session is working by obtaining the Session …

HTML Special Characters Poster
Friday, 3 October 2008 – | No Comment

Remembering the code or entity combinations for special characters when designing HTML pages can be a chore so I have been jotting them down as they crop up. Having a few moments spare I have …

PHP: Process Technorati API
Friday, 3 October 2008 – | No Comment

Processing the Technorati API allows you to receive information about your blog and rankings logged with the Technorati service. An example of extracting various pieces of information is here
$url = “www.yourchosendomain.com”;
$apikey = “putyourapikeyhere”;
$service = “http://api.technorati.com/bloginfo?key=” …

PHP: XML element information
Friday, 3 October 2008 – | No Comment

Obtaining information regarding elements in XML is relatively straight forward
// xml input file
$xmldoc = “sitemap.xml”;
// test to open file
if ( !$dom = domxml_open_file($xmldoc) )
{
echo “The file cannot be loaded.”;
}
else
{
// show top level item
$elem = $dom->document_element();
print_r( …

PHP: Highlight a keyword in a phrase
Thursday, 14 August 2008 – | No Comment

PHP Routine to highlight a keyword in any given phrase:

function highlight( $phrase , $keyword)
{
$parts = explode( strtolower($needle), strtolower($phrase) );
$pos = 0;
foreach( $parts as …

PHP: Select the latest image or file in a folder
Wednesday, 23 July 2008 – | No Comment

It can be useful to set a placeholder in a web page, such as an image, and for this place holder to be set to be the latest file in a given folder; or to …