What am I doing? I’ve been in bed all week with a bad cold, I’ve managed one run since the Cardiff Half where I pulled my left calf, and now I’m stood out in the freezing driving rain about to run another one!!! Standing at the start line, soaked to the bones already, the hooter goes…. here we go again :) Continue reading 'Tour of Torfaen Half Marathon'»
I’ve come up with a problem recently returning data via an XML feed using AJAX. In my case I was returning a list of images each having several links to perform various tasks (e.g. set as main image, add as thumbnail, add full image, etc).
It’s quite simple to fix you simply need to normalise() your returned data in your AJAX script. Simply add the second line once you’ve gathered your XML data:
xmlResponse = xmlHttp.responseXML;
This will solve the 4096 character limit when using Firefox 2 or any other browser I haven’t checked that doesn’t normalise the data automatically.
Please ignore this post, quite frankly its old and there’s much better ways to do stuff than this.
$sql = "insert into table set ";
Â foreach ($_POST as $key => $data)
Â Â Â Â $sql .= $key." = '".strip_tags(htmlentities(addslashes($data)))."',";
Â $sql .= mysql_query(rtrim($sql,',').";") or die(mysql_error());
What this script does is to take your $_POST data and remove anything malicious from it. Looping over the $_POST data we build up an SQL statement. At the end then we simply execute using with mysql_query.
NOTE: This does not validate your data, it just helps prevent malicious attacks.
Another version of this that I use to to grab all my form information into variables to to place the following code within the foreach loop instead…
eval("$".$key." = '".strip_tags(htmlentities(addslashes($data)))."';");
This makes up a list of variables following your forms field names and strips malicious code from them. This method then allows you to do some form validation before inserting data into your tables ;)
So today was it, my first half marathon. Training had gone fairly well, I’d managed to do my over the mountain half training several times my best time on that being 1 hour 57 mins roughly. A few days of tapering, which generally meant I felt rubbish and there I was standing on the start line at 8:30am. I finished in 1 hour 48 mins 44 seconds. Continue reading 'Cardiff Half Marathon 2007'»
Dive Signs required a low cost solution due to being a start up company. Dive Signs are a family run business based in Essex they sell highly reflective vinyl stickers for the scuba diving industry. The solution for Dive Signs was a customised install of Zen Cart, the entire site took less than one week to get up and running and they are already expanding their online catalogue.