Google Change The Meaning Of ‘Free’

I have been promoting one of my other sites recently and when I saw my latest ‘Free’ Google AdWords voucher (they’re not exactly uncommon!) I thought I may as well give it a go. I have never used AdWords before so I went through the sign up process with my voucher in hand.

I created my campaign and didn’t mind the fact that that they wanted billing information before they could activate my account – but then I noticed that there was a ‘activaion fee’ of £5 in my case that I needed to ay in order to activate my account. I took another look at the ad – yup “Try it for free – £50.00* FREE advertising. No risk. No obligation” and then I looked at the small print – “A £5 account activation fee or equivalent credit deduction required”.

That sounds neither ‘Free’ or ‘No obligation’ to me.

Perhaps the ad is targeting existing AdWords users where they have already payed their fee? Nope – “The promotional code can only be used for AdWords accounts less than 14 days old”.

It might not have annoyed me if it was aimed at being ‘Free’ to existing members who have already paid their fee, but the fact they are targeting new customers with the promise of ‘No Obligation’ which is a down right lie. You may think that £5 isn’t worth getting worked up over – but I feel this kind of advert is deceiving.

Needless to say I did’t bother continuing my account creation. So all this advert did was waste my time, annoy me and give me yet another reason to dislike the big G.

Rant over.

Tags: DislikesSearch Engine Stuff

moreHawes Through Time

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!

morehawes version 1

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.

morehawes version 1

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.

morehawes version 1

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.

morehawes version 1

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.

moreHawes meets Wordpress!

Tags: InternetMeWordpress

Nochex Steal Your Money

For a client recently I had to test osCommerce was accepting Nochex payments. Having never used it before I went through the lengthy and painful process of signing up for a Nochex account.

Well now I know why no one used Nochex. It’s rubbish. It’s the only thing that would make me recommend Paypal (and I hate Paypal) to anyone but at least their service does what it is supposed to with minimum fuss.

OsCommerce was working fine and accepted my Nochex account but Nochex wouldn’t accept my address, so I was unable to put a card straight through (as a user without an existing Nochex account might). So I gave up on that as the client offers their own credit card gateway.

So I thought that was that – but when you add a credit/debit card to Nochex they debit a ’small’ amount from your card to help with their verification process. They didn’t go out of their way to tell you this when you register and they certainly don’t make it clear enough that this is non-refundable!

So there I was waiting for my couple of quid to get refunded only to discover it has been stolen. And for what? … other one for ‘the list’

Tags: 1BoycottsDislikesMeSearch Engine Stuffe-commerceosCommerce

Easily Generate Javascript and PHP Error Checking For Your Forms

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: JavacsriptPHPProgrammingWeb Development

Magento Theme / Templating Tutorials, Guides and Resources

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)

Tags: MagentoWeb Developmente-commerce