Usability, accessibility and screenreaders

This video from the University of Arkansas shows why descriptive text rather than ‘click here’ should be used for links and how skip navigation can improve user experience.

Change date from American format in ASP

This short ASP script will change the date in your database table from American format to a format which can be understood universaly.

OrderDate in the script refers to the column in the database table where the date is stored.

<%
'Change from American date format
If Day(DBOutput("OrderDate")) < 10 Then
'add a leading zero if date is single digit
Response.Write("0" & Day(DBOutput("OrderDate"))) & " "
Else
Response.Write (Day(DBOutput("OrderDate")))  & " "
End If
Response.Write(MonthName(month(DBOutput("OrderDate")), true)) & " "
Response.Write (Year(DBOutput("OrderDate")))
%>

Database connection script

As a developer, you probably use different servers throughout the development process. When you move your application from one server to another, you maybe have to change the database connection script in order for the application to work on the new server.

If you forget to do this, and the client is sitting in front waiting to see their new web application, it can be quite embarrassing. So, use this script to include several servers in your database connection statements and all will be fine.

<?php

/*This file is intended to be able to connect to your MySQL
database no matter where it is situated.
Insert your connection details for your different hosts into the
switch statement below.
You can add more hosts if you need to. */

$host = $_SERVER['HTTP_HOST'];

switch ($host)
{
case 'localhost':
$server = '';
$user = '';
$db = '';
$password = '';
break;

case 'domain of host 1':
$server = '';
$user = '';
$db = '';
$password = '';
break;

case 'domain of host2':
$server = '';
$user = '';
$db = '';
$password = '';
break;

default:
$server = '';
$user = '';
$db = '';
$password = '';
}

$link = mysql_connect($server, $user, $password);
if (!$link) {
die('Could not connect: ' . mysql_error());
}

$selected = mysql_select_db($db,$link)
or die("Could not select database");

?>