The HTML song
Posted by by Dave on 6th Dec, 2009
A song about HTML by the Hot Toddies. The internet has it’s great points and also some to be avoided.
P.S. You won’t learn any HTML from the song, I just find it amusing
Hit play to listen to it…
Posted by by Dave on 6th Dec, 2009
A song about HTML by the Hot Toddies. The internet has it’s great points and also some to be avoided.
P.S. You won’t learn any HTML from the song, I just find it amusing
Hit play to listen to it…
Posted by by Dave on 22nd Nov, 2009
Posted by by Sandy on 31st Oct, 2009
It is very easy to detect your users country and I’ll show you how using php.
Step 1 – Detect user IP address
PHP has wonderfully simple function do this. All you have to do is use:
$_SERVER['REMOTE_ADDR'];
We’re going to store this as a variable called ip:
$ip = $_SERVER['REMOTE_ADDR'];
Step 2 – Check location of IP address
We’re going check location of IP address with a function called locateip which uses the free geolocation API available at http://ipinfodb.com/
The locateip function has 4 sections as follows:
1. Make a request for an XML file from ipinfodb.com.
2. If first request fails make request to backup server.
3. Extract the country and country code from the XML.
4. Store everything in an array for convenience.
function locateIp($ip){
$data = file_get_contents("http://ipinfodb.com/ip_query_country.php?ip=$ip&output=xml");
//Use backup server if cannot make a connection
if (!$data){
$backup = file_get_contents("http://backup.ipinfodb.com/ip_query_country.php?ip=$ip&output=xml");
$answer = new SimpleXMLElement($backup);
if (!$backup) return false; // Failed to open connection
}else{
$answer = new SimpleXMLElement($data);
}
$country_code = $answer->CountryCode;
$country_name = $answer->CountryName;
//Return the data as an array
return array('ip' => $ip, 'country_code' => $country_code, 'country_name' => $country_name);
}
We would call the function using:
$ip_data = locateIp($ip);
Step 3 – Display on page
All we have to do now is display the information on the page using the array
echo $ip_data['country_name'];
You may wish to store details within session variables so you can use on multiple pages without having to perform the check again.
You can see the code in action at http://www.amgmedia.co.uk/country.php
I’ve went a little further and used the country code in combination with the free flag icons available from http://www.famfamfam.com to add the appropriate country flag. All the flags are named after the country code so it’s quite easy to do.
By making a slight change to the XML file requested from IPInfoDB you can also detect the users city with latitude and longitude. Check out the example at http://www.amgmedia.co.uk/location.php Although, this may not always be accurate depending on the users ISP. You will see I also added a map which is generated using the latitude and longitude and Google maps API.
IPInfoDB does not have a query limit as such but if you send an queries that are at a rate faster than 2 per second they will be put in “queue”. If you stay below 2 queries/second everything will be normal. If you go over the limit, you will still get an answer for all queries but they will be slowed down to about 1 per second.
If your not too happy about having to rely on using an API then IPInfoDB lets you download their IP database as SQL and use what ever method you choose to query it.
On both examples I have provided you can look at the code and try it out on your own. Although, if your testing on a local server your IP address will show as 127.0.0.1 depending on how you have configured your localhost.
That’s all folks!
Continue readingPosted by by Dave on 26th Oct, 2009
Here is a short video explaining the rapid rise of social media in mainstream culture…
There is no doubt that the world is going through some fundamental changes in the way we communicate. The media world as we know it (tv, radio, newspapers) is crumbling. Our attention and time is now going online.
In the near future there will not be just a hand-full of TV networks and subscription services but and endless amount of video content (not to mention audio podcasts and blogs) supplied to us on demand for whatever topic interest us, through our broadband connections.
Who will create this content? Anyone with enough passion an a topic.
In fact, this has already been happening for some time, and the momentum it has gathered is now signalling the start of a Social Media Revolution.
One man at the forefront of the Social Media revolution is Gary Vaynerchuk who grew his family’s New Jersey wine store to a $40 million online retail business after creating Wine Library TV, an online show in which he reviews wine for 30 minutes ever day.
As more and more people flock to the Internet for information and entertainment, small businesses can benefit from the kind of exposure that only big brands could afford in the past.
TV, radio and print advertising is very expensive and rarely relevant to small business as the audiences are too big. In social media, content specific to your local area, or particular narrow niche, created for a much more targeted and smaller audience is common place.
Say for example you run a hotel in picturesque rural village. By creating a blog or podcast about the village, talking about the things that make it special, the events that people visit, etc, you are creating a source of information for people looking to find out about the place. You would be creating the kind of content that search engines love, people would share, and where people would hopefully end up when looking for a nice place to go for a break.
This platform would then serve as an indirect source of new customers for the hotel.
Regardless of whether you chose to implement a Social Media into your Marketing as a proactive way of finding new customers, people are using open Internet forums to discuss brands, services and the businesses that they deal with.
That means that any bad experience one of your customers has can be on the web and accessible by anyone considering your service.
No business is perfect and not all customers are easy to please. But unless you are active online, engaging with your customers and putting out there the kind of content that reflects positively on your business, then you are not in control of your brand.
Need help implementing Social Media in your Marketing? Fill the contact form below…
Posted by by Dave on 18th Oct, 2009
When it comes to finding local services, google is fast becoming the most convenient and popular resource. But are local businesses making use of the platforms available to them?
local service listing on google search
While I was on holiday recently in Egypt I went on a few organised trips, which I had researched prior to travelling, planning to contact the excursions company once in the resort. With no phone number advertised I thought it would be simple to find their local office, first call – Google.
Unfortunately they did not have their local office listed, which made me think of how many other people travelling to the same result with the same intentions as me had the same problem, and as a result how much business the agency was losing.
And how about people who don’t know of your business yet, but are looking for a local service?
Ranking for a service keyword, especially in a competitive market, can involve some work, but if you have premises in the location where you are offering the service, getting listed on googlemaps is relatively easy and a great way to get in tap in to searches for local services.
Say you have a café in a small town, like in the example above. Tourists and visitors to the area might want to know in advance where they can go for something to eat and do a search on google, or do a search from their smart phones looking for the nearest place to have a bite…
When looking for a service + a geographical location in a web search, google will often append the googlemaps listing for that service into the search results.
Others might go straight to google maps and search for the nearest cafés on the map.
Either way, what you get is a list of cafés in the area placed on the map so you can see how far you are from them and how to get there, with a phone number and customer reviews!
If your smart phone is GPS enabled, you can even ask it to give you exact directions to take you there.
This is a useful tool for local businesses already, but two things are happening that will make it more and more…
1. More and more people are using google to search for a local service.
2. More and more people are switching to smart-phone devices that are used to get information while on the move.
Fortunately I managed to get my trips organised, but if you have a business offering a local service you should definitely be taking into account that a lot of people will use google to find you.
Here’s where to get started… http://www.google.com/localbusinesscentre
Need help getting your local business ranking on Google? Fill the contact form below
Posted by by Gavin on 2nd Aug, 2009
A support question we are sometimes asked by other developers is how to export information from web pages to an excel spreadsheet. This tutorial shows the key elements for exporting dynamic information from a database query.
so here goes…
- <?php
- require_once (’lib/config.inc.php’);
- require_once (MYSQL);
- $filename =”excelreport.xls”;
- $q = “select * from student order by studentSurname, studentFirstName asc”;
- $r = @mysqli_query ($dbc, $q) or trigger_error(”Query: $q\n<br />MySQL Error: ” . mysqli_error($dbc));
- $contents =”Surname \tFirst Name\tEmail\tDOB\tAddress1\tAddress2\tTown\tPost Code\tSQA\t \n”;
- while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) {
- $contents .=”".$row['studentSurname'].” \t”.$row['studentFirstName'].”\t”.$row['studentEmail'].”\t”.$row['studentDOB'].”\t”.$row['studentAddress1'].”\t”.$row['studentAddress2'].”\t”.$row['studentTown'].”\t”.$row['studentPostCode'].”\t”.$row['studentSQA'].”\t \n”;
- } //end of while loop
- header(’Content-type: application/ms-excel’);
- header(’Content-Disposition: attachment; filename=’.$filename);
- echo $contents;
- ?>
The above code explained -
Line 1 – kicks off the PHP code with the opening PHP tag.
Lines 2 and 3 – makes the database connection. I’ve stored by connection in a separate file called config.in.php – I’m also using MySQLi (improved).
Line 4 sets up a variable for the file name.
Lines 5 and 6 – query the database for the information I’m looking for and stores the results in an array called $r.
Line 7 – sets up a variable called $contents and inserts the column headings for my excel spreadsheet.
Line 8 – starts are ‘while loop’ to extract information from the $r array from the query on the database.
Line 9 – appends the information for each result to the $contents variable.
Line 10- end the ‘while loop’.
Lines 11 and 12 – set up the file details for an excel spreadsheet.
Line 13 – echos the $contents variable.
Line 14 -closes the php code.
To try this out, replace the query in the code to a database you already have, update the database connection to your details then copy this code and save it as excel.php, then on any other page simply insert a link to it.
Continue readingPosted by by Dave on 27th Jun, 2009
Just came across this example of a website review meeting I thought you might find funny (It’s 3 minutes long).
Need a simple to understand and uncomplicated advice and help with your website? Get it touch with us about your Website Development requirements!
Continue readingPosted by by Dave on 25th Jun, 2009
So you want to be a web developer? Have a look at these guys, you might change your mind…
Don’t do it to yourself, don’t do it to your family!
We’ll take care of the designing, coding and marketing. We’re too deep in this now, but we can help people like you escape! Just give us a call – we’ll take care of it ;-)
Continue reading