How To Create A YouTube Style Button Using HTML/CSS3
Posted Thursday September 15th 2011
A video tutorial showing how to quickly create a button similar to the “Create Account” button displayed on the YouTube homepage using HTML and CSS3.
Using the Coda text editor we can edit our HTML/CSS, preview in browser and also compare this to the YouTube button all in one window!
View the demo:
http://morehawes.co.uk/tutorials/create-account-button/index.html
View the source:
http://morehawes.co.uk/tutorials/create-account-button/index.html.txt
CSS3 gradient generator used in tutorial:
http://gradients.glrzad.com/
More advanced CSS3 gradient generator:
http://www.colorzilla.com/gradient-editor/
DuckDuckGo:
http://duckduckgo.com
Joe
Tags: Web Development
Add eBay Listings To Your Website In Seconds
Posted Sunday March 21st 2010
If you sell things on eBay then getting your listings seen by as many people as possible can be the difference between selling your item for 99p or £99. Whether you use eBay as an additional outlet for your existing online business or as a way of clearing out your garage – listing your items on your website can be an excellent way of directing visitors of your site to your eBay listings.
Keeping your listings up to date can be a real headache which is why having a listing tool such as Auction Nudge that automatically updates and displays your current eBay listings on your website can be a real time saver.
The listings below are generated by pasting one line of code into the HTML of your web page (Note: I am not affiliated with this eBay member in any way.) :
This is generated by the following code :
<script type="text/javascript" src="http://www.auctionnudge.com/0.5/build.php?ebayID=soundswholesale&type=user&site=uk&cols=2&limit=4&theme=4"></script><div id="auctionNudge"></div>To get Auction Nudge working on your site you can either copy the above code, changing your eBay ID as necessary and pasting it onto your web page or by visiting Auction Nudge to enter your display settings and get your listing code. There is no registration required and you can view a demo of how your listings will look by just entering your eBay username!
Tags: eBay • Web Development
moreHawes Through Time
Posted Thursday February 4th 2010
Since I have been working on updating this site recently I thought I would delve into the history books (not really that far back) and look at the previous versions of my website.
Although slightly pointless, I have spent a fair bit of time making these so it’s nice to remember.
Version 1
Between around 2004 – 2005, I made this site before I even knew what programming really was, but that didn’t stop me wanting to be a web designer!

The site consisted of a simple 5-page site with a few fancy animated graphics. Still now I like how this site looks.
Version 2
Around 2005 – 2007. I knew a bit of PHP by now and decided that a new site was in order! Re-inventing the wheel slightly I write some scripts for comments, a basic forum and a few other twiddly bits.

Version 3
Around 2007 – 2008. Enter Drupal! I quickly realised the potential of using a content management system, though at this stage I was using it pretty much out of the box.

Version 4
2009 – 2010! Still using Drupal but heavily customised with my own theme. I have organised my content in more of a blog style with all sorts of fancy witchcraft working behind the scenes.

Version 5
2010 – present. Hello WordPress! A complete re-write, re-design and migration to WordPress. Since starting to use WordPress it quickly because my CMS of choice with it’s long features list and great community support. It’s a tool that really makes publishing on the web a hassle-free task.

Tags: Web Development
Web Usability – Even The Big Boys Get It Wrong
Posted Tuesday April 28th 2009
At work recently I have been looking into usability principles and in particular our checkout procedure. This consists of streamlining the process by reducing the number of hoops the user must jump through whilst trying to build confidence in the customer.
Whilst booking flights to Australia the other day I was surprised that even the big boys can get it wrong! Although the checkout procedure was smooth – this screen was the first thing I saw after I clicked the “pay” button:


Not exactly confidence building! This page is supposed to redirect the user to their card holders ‘secure code’ page to prevent fraud and authorise payment. However when the re-direct doesn’t work a green screen with a form button seems to be enough to maintain the users confidence confidence!
Tags: Web Development
Easily Generate Javascript and PHP Error Checking For Your Forms
Posted Friday April 10th 2009
I wanted a quick and easy way of adding Javascript and PHP error checking to my form elements. The benefit of this is that errors can be caught using Javascript before the form is submitted, but if JS is disabled in the users browser then the error is still caught using PHP.
The method I came up with to solve this is very simple and can be easily added to form elements with little extra code. The error checking is done by checking input against regular expressions.
See the demo and demo source code.
Code Explaination
One function is used to create both forms of error checking:
<?php $jsChecks = ""; //holds JS error checks $errorFound = false; //PHP error flag //Creates both JS and PHP error checks function errorCheck($elementName, $regExp, $errMsg) { global $jsChecks; global $errorFound; //Create Javascript error checking $check = ' var ' . $elementName . 'Filter = ' . $regExp . '; if (!' . $elementName . 'Filter.test(theForm.' . $elementName . '.value)) { errorMessage += "\n * ' . $errMsg . '"; errorFound = true; }' . "\n"; $jsChecks .= $check; //PHP error checking and return input class if(isset($_POST["formSubmitted"])) { //if form submitted if(!preg_match($regExp, $_POST[$elementName])) { $errorFound = true; return "error"; //css error class } } return ""; //no class if no error detected }
Error checking is created for the form elements specifying which element (by name), a regular expression to be checked against and a custom error message:
//Create error checking $nameError = errorCheck("name", "/([a-z0-9]{3}[a-z0-9]?)/", "Name is too short"); //Must be 3 chars or over $emailError = errorCheck("email", "/^[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}$/i", "Invalid Email Address"); //must be valid email address
If no error is found then process the data.
//If no error found if(!$errorFound) { //Process form data... } ?>
In our head tags we add the following Javascript and CSS rules. The Javascipt checks we created for each element are included here by the PHP ehco:
<style type="text/css"> input { border: 1px solid #DDD; } .error { border: 1px dashed #F00; } </style> <script type="text/javascript"> <!-- function validateForm(theForm) { var errorFound = false; var errorMessage = "Please correct the following errors:\n"; <?php echo $jsChecks ?> if(errorFound) { alert(errorMessage); } return !errorFound; } //--> </script>
The form is really simple with code to display a CSS class depending on whether a error is detected (for the PHP error checking) and to set the value of the field:
<form method="post" onSubmit="return validateForm(this)"> <label for="name"><strong>Name</strong> (must be 3 characters or over)</label><br /> <input type="text" name="name" id="name" size="30" class="<?php echo $nameError ?>" value="<?php echo @ $_POST['name'] ?>" /><br /> <label for="email"><strong>Email Address</strong> (must be a valid email address)</label><br /> <input type="text" name="email" id="email" size="30" class="<?php echo $emailError ?>" value="<?php echo @ $_POST['email'] ?>" /> <br /> <input type="hidden" name="formSubmitted" id="formSubmitted" value="true" /> <input type="submit" value="Submit" /> </form>
There you are, both Javascript and PHP error checking! See the complete source code here.
Tags: Web Development
Magento Theme / Templating Tutorials, Guides and Resources
Posted Monday February 9th 2009
I think anyone that has worked with Magento will agree that it is a steep learning curve, this is not helped by the lack of documentation. I have put together a list of useful links when that I found helpful whilst trying to get my head around Magento themes:
(I have expanded upon these lists which I found useful)
- Php|architect’s Guide to E-Commerce Programming with Magento
- Designer’s Guide to Magento – The most solid of Magento’s documentation, though it might take a few reads before things become clear! (pdf version)
- The Magento API
- Magento Screencasts
- Designing for Magento Webinar – worth watching the wmv file as much better quality
- Magento Wiki – out dated but some handy concepts
- Ohminu forum post – the lead designer breaks things down for newbies
- Magento Folder Structure
- Changing Text – using the Locale File
- Builing Blocks – more handy hints from the lead designer
- Screencast on creating themes – a very brief introduction to creating a new theme
- Video’s and other resources from php | architect
Tags: e-commerce • Web Development
Windows Text Editors
Posted Friday February 6th 2009
I’m a Mac user through and through but recently I have been required to use Windows for work. My favourite text editor for Mac is undoubtedly Textwrangler which is a free stripped-down version of Barebones BBEdit. This is a great text editor that does everything I need.
After having such good experiences with Textwranger on OS X my job was finding a Windows alternative. Other than the usual features (syntax highlighting etc) I was looking for:
- FTP Support (though I do not use this text editor feature on OS X, this was a requirement for me on Windows)
- Powerful multi-file search / replace
- Tabbed file editing
- Smart indenting- shortcuts to indent / unindent whole blocks of text
- Matching brackets
After some searching and testing of various solutions I found Crimson Edit, this is a great text editor that is also free! The only small problem I have had is a few bugs in the FTP connections but this is forgiveable and for me was the best free text editor for Windows. Crimson Edit has been open-sourced because the developer had no time for it any more.
Unfortunately Crimson Edit does not support SFTP connections so I had to look further. In the end I went for EditPlus. This application costs but is fairly cheap (35USD / 30 day trial available) and has a extermely powerful array of features (like Search / replace regular expression support and advanced (S)FTP support with file browser pane). I found out about this editor as it is used by the Magento developers.
Tags: Web Development
