home | contact us
» Archive by category "web development"

category: web development


Recently the good folks at chrome have added a feature where you can reload without the cache, which is in a right-click on the reload button, but I was really confused as some machines seem to have it and others don’t.

The key is whether developer tools is open or not! If you’re using a recent version of chrome, press F12 to open the developer tools and then you can right-click the reload button, and you get three options – Reload, Hard Reload (redownloads images) and Empty Cache and Hard Reload.


 

If you’ve ever had that annoying problem where someone has asked you to put a flash banner on a site and it covers up your nice dropdown or pop-out menus, you’ll be glad to know that the current versions of flash don’t do that if you set the right parameter! Yes that even includes flash on Linux browsers!

The parameter is called “wmode” and needs to be set to “transparent” for the z-index problem to go away.

Don’t forget that search engines don’t read the text in flash files so you don’t want to use flash where you don’t have to, but when a banner is required and is provided by a third party it’s not always possible to avoid it.


 

If you are feeling lazy, or would like to build in some future proofness into your system, you can use the MySQL Desc query to get table column information and then use this information to create dynamic SQL insertion strings.

For example:

$cols_query = db_query("desc table");
while($cq = mysql_fetch_assoc($cols_query)){
	$cols[]=$cq;
}
foreach($cols as $c){
	if(!empty($_POST[$c['Field']])){
		$sets[] = $c['Field'] . " = '" . mysql_real_escape_string($_POST[$c['Field']]) . "'";
	}
}
mysql_query("insert into table set " . implode(', ', $sets));

 

I have been looking for this for ages – A URL pattern matching cache controller to disable caching on local / dev sites whilst maintaining normal caching operations on the rest of the web.

The solution is a Firefox addon called Johnny Cache (boom boom)!


 

Sometime in MySQL you want to copy an entire table from one database to a separate database. One example of when you would want to do this is if you are making a backup of a table before you apply some kind of processing to that table. There is nothing worse than ruining a database table and losing valuable information. To make an instant backup is so easy that there really is no excuse not to make backups at important or risky stages.

Here is how to do it:

[mysql]
DROP TABLE IF EXISTS backup_db.backup_table;
CREATE TABLE backup_db.backup_table SELECT * FROM live_db.live_table;
[/mysql]

This will delete your existing backup table completely, then will remake it copying all structural information and content from the live_table in the live_db.

Related Blogs
http://www.phpclasses.org/browse/package/4017.html
http://www.sematopia.com/?p=61
http://www.yinfor.com/blog/archives/2008/02/mysql_backup_and_recovery_meth.html


 

My favourite platform for web development has to be Ubuntu Linux. As a desktop system to work on (rather than play) I think it is unsurpassed. However there are some times that you really need to use windows. For example my laptop seems to refuse to install Ubuntu which means that I am forced to stick with windows XP for the time being. However windows can be a perfectly adequate web development environment.

One of the trickiest aspects of web development on windows used to be setting up the Apache, MySQL and PHP stack. However this is no longer the case thanks to the wonderful little package called XAMPP. This is short for XP, Apache, MySQL, PHP and Perl.

Xampp allows you to run a webserver on your local computer. This allows for superfast editing and checking of your web application. Anyone who has repeatededly edited and FTP’ed a file to a webserver will know that it can quickly become a pain and definitely slows down your performance as a programmer.

By editing the file locally and simply refreshing your web browser you can quickly see how your web design is looking or ensure that your PHP is not throwing any errors etc.

Furthermore, using XAMPP allows you to start and stop the entire web server stack easily from one simple control panel.

Download XAMPP from hereĀ 


 

osCommerce is an awesome ecommerce package. It has many critics and this is mainly due to the fact that unlike many modern open source packages it is not really ready to run “out of the box”. That is a drawback, however it is not really so much of a drawback when you take into account that anyone that would want to establish an ecommerce presence is going to be very keen to modify the package to make the site look and feel unique.

This is where osCommerce really shines as it is very easy to modify and there is a huge user base with literally thousands of plugin modifications or “contributions” in osCommerce speak which can help you to make your store work in exactly the way you want.

There are some things though that are highly recommened for every osCommerce store though:

1. Search Engine Optimisation

As standard, osCommerce really is not very search engine friendly. Search engine friendliness is the first step towards search engine optimisation. This of course means that there are a fair few things you need to do to your store to make it truly search engine optimised. However, they are worth the hassle (especially if you get us to do it for you) and once you have some SEO modifications implemented, you will be able to start to get indexed and gaining visitors from the search engines without having to pay per click.

2. Speed

There are a few key things that every store should really do to speed up osCommerce. If however you expect your store to have a lot of visitors and/or display a lot of products and categories then you will really benefit from giving the front end of the site a bit of an overhaul in certain areas. The speed improvements possible are really quite dramatic and can make the difference between your visitors sailing through the site straight to the page or product they want or them getting bogged down, bored and finally leaving before they even get where they want to be.

3. Security

osCommerce is pretty secure out of the box. The admin side obviously needs some password protection and can be made more secure if it is felt neccessary. An easy modification is to simply rename the admin folder into something that only you know.

4. User Friendly

The osCommerce ecommerce system is fairly user friendly from the outset. One area that many people prefer to modify though is the checkout procedure which can be a bit long winded for some.

5. Easy Administration

Admin side there is a whole host of things that you can do to make your and your employees’ lives easier. For example adding products one by one using the admin tool can be a bit tedious and slow. Easypopulate is an awesome addition to any osCommerce store allowing easy population and editing of the product catalogue using your favourite spreadsheet program. We like Open Office for this task.

Part of the joy of running your own web site is that you are free to edit, change, personalise and improve it to your hearts content. Some things you will add because they make a real difference to your bottom line and some things you will add just because you think its a good idea or will be cool. The great thing with osCommerce is that you can edit it and make it work the way you want.

If you are not confident with PHP or the change you want to make is a bit more complex than you can handle, then we are more than happy to get in there and give you a hand!


 

Ubuntu Linux is undoubtedly the most successful desktop version of linux available today. It has managed to tempt across many dedicated windows users with its easy installation procedure, comprehensive bundle of applications including open office and firefox, its greater security and reduced vulnerability to internet viruses and malware. And of course the fact that it is free to download and install.

For a web designer, it is nice to have a sleek desktop environment to code in whilst being able to run a full LAMP stack web server as the localhost – meaning that designing and developing web sites is a breeze.

However, there are times when you simply need to check that a design is going to work with Internet Explorer. Microsoft’s Internet Explorer web browser is bundled with windows and is therefore the most popular web browser at the moment. However as a web designer it causes problems as it often behaves erratically or unexpectedly. For this reason a web designer always needs to make sure that they check their designs in Internet Explorer.

Another reason that Ubuntu users may need to use Internet Explorer is to log into certain sites which are not compatible with anything other than Internet Explorer. This is a real pet hate as it is real sign of laziness on the part of the web designers not to ensure that their web sites are accessible by all web browsers. Unfortunately the sites that tend to be like this are the ones that you really need, such as online banking sites. Its probably something to do with sloppy handling of ssl secure and insecure content, but I am not sure on that one.

Anyway – to save you having to maintain a windows installation and reboot everytime you need to check something in Internet Explorer – there is the excellent IEs 4 Linux package. This great package allows you to easily install Internet Explorer under Ubuntu (or any other version of Linux).

You need to have WINE installed and working, and also have the cabextractor working. Both of these packages are available in the syntaptic package manager in Ubuntu.

Related Resources

http://novicenotes.net/2006/08/04/ie_on_linux_wine/

http://blog.taragana.com/index.php/archive/how-to-run-microsoft-internet-explorer-7-6-55-51-in-linux

http://alternativenayk.wordpress.com/2006/11/27/internet-explorer-on-linux-help-for-xfld-ubuntu/

http://www.liewcf.com/blog/archives/2006/04/install-internet-explorer-6-on-linux


 

The web developer toolbar is an excellent addition to the great firefox web browser. It allows you ultimate control over the behaviour of your web browser and helps you to fine tune layouts. The toolbar has a real time html and css editor built in which is great for tweaking things. For those of you who have a nice big 22″ monitor to develop on, the resize functionality is awesome for replicating the viewport of whichever resolutions you want, so that you can ensure your layout still works on an 800 x 600 display for example.

As a web development tool for those of us who hand code things instead of using dreamweaver or whatnot – it is an excellent tool.

You can download the web developer toolbar here

Unfortunately there is some kind of bug with Firefox where if an update fails or the browser crashes, then your web developer toolbar may stop working. In fact it is still working but all of the icons disappear. All you have to do to fix it is right click it, select customize and then select “Restore Default Set”. Thanks to Voodish for the fix.


 
rss icon