+44 7881601035 Skype: dangibas

HYGEN Blog

Web Design • Web Development • Project Management • Travel

HYGEN Blog HomeHome » Technology

Dan Gibas

Dan Gibas, Director, HYGEN HYGEN Web Design
A British expat web monkey living in Malaysia. Hire me!

HYGEN Blog Posts In The ‘Technology’ Category

Generate a drop down select box for year selection in Yii (PHP)

Wednesday, November 3rd, 2010

You can use this PHP code with or without the Yii framework to generate a select box of years. It’s useful for date of birth etc and especially brilliant for sites with minimum age requirements. The code only outputs valid years of birth for over 18′s only.

Read the rest of this entry »

mysqldump: command to backup a database on another remote server

Thursday, August 12th, 2010

MySQL: mysqldump command tip!

MySQL: mysqldump command tip!

The mysqldump program is often used to getting a data dump of a local database for backup reasons or just for moving a database from one server to another. To make this even easier, mysqldump can accept a remote host as an arguement. This means that if you are logged into server A you can get a backup of server B immediatly without having to login to server B and then transfer the file manually vis FTP or SCP etc. Just use this command:

Read the rest of this entry »

The Importance Of Server / Web Host Location

Wednesday, July 14th, 2010

You may have heard of the importance of the geographical location of your servers when running websites. What you may not realize is just how important it is, especially to Google.

Firstly you need your servers to be geographically close to your target audience so the load times will be faster because packets of data won’t have to travel so far and can avoid more bottlenecks in the network. So the closer the server to the user, the better the speed and service.

Secondly, search engines take the geographical location of your servers / web hosts into account when ranking your sites. If your site is hosted in the US then you will get more US traffic and less from the rest of the world, likewise if it’s hosted in Japan then you can expect more Japanese traffic and less from elsewhere.

To illustrate the importance of server location check out these images. They clearly show a shift in traffic sources when the web server moved countries from Malaysia to the UK…

Server usage by country 12/2009

Server usage by country 12/2009

Read the rest of this entry »

Setcookie() Path Problems / Gotchas In PHP

Thursday, April 22nd, 2010

Cookie Problems With PHP?

Cookie Problems With PHP?

From php.net:

“The path on the server in which the cookie will be available on. If set to ‘/’, the cookie will be available within the entire domain. If set to ‘/foo/’, the cookie will only be available within the /foo/ directory and all sub-directories such as /foo/bar/ of domain. The default value is the current directory that the cookie is being set in.”
Read the rest of this entry »

Use JQuery To Automatically Set IFrame Height

Wednesday, April 21st, 2010

Auto Adjust IFrame's Height With JQuery

Auto Adjust IFrame's Height With JQuery

It’s a fairly common problem when developing web applications and using IFrames (inline frames) – the height of an IFrame can’t easily be determined and it’s essentially dynamic as it depends on content and CSS inside the framed page.

Read the rest of this entry »

Ubuntu VS Windows According To Dell UK

Sunday, April 18th, 2010

UbuntuI was doing a bit of research today to see how the relationship between Canocial (Ubuntu) and Dell is.  It’s great that Dell sells Ubuntu based computers but what’s not so great is what trash they are publishing on their web site.  Here is a quick excerpt: 

Read the rest of this entry »

Use Perl Audio Converter (pacpl) To Convert Audio Files On Ubuntu Linux

Sunday, March 14th, 2010

Running the pacpl program without options

Running the pacpl program without options

Download and install the Debian package (works for Ubuntu) for the Perl Audio Converter – http://pacpl.sourceforge.net/downloads.html

Then use dpkg -i command to install the package.

From the Perl Audio Converter website:

“Perl Audio Converter is a tool for converting multiple audio types from one format to another. It supports AAC, AC3, AIFF, APE, AU, AVR, BONK, CAF, CDR, FAP, FLA, FLAC, IRCAM, LA, LPAC, M4A, MAT, MAT4, MAT5, MMF, MP2, MP3, MP4, MPC, MPP, NIST, OFR, OFS, OGG, PAC, PAF, PVF, RA, RAM, RAW, SD2, SF, SHN, SMP, SND, SPX, TTA, VOC, W64, WAV, WMA, and WV. It can also convert audio from the following video formats: RM, RV, ASF, DivX, MPG, MKV, MPEG, AVI, MOV, OGM, QT, VCD, SVCD, M4V, NSV, NUV, PSP, SMK, VOB, FLV, and WMV. A CD ripping function with CDDB support, batch conversion, tag preservation for most supported formats, independent tag reading/writing, and extensions for Amarok, Dolphin, and Konqueror are also provided. “

Read the rest of this entry »

Drupal: HTTP request status fails / Drupal Status Page Reports Errors

Tuesday, February 23rd, 2010

Drupal status: http request fails

Drupal status: http request fails

HTTP request status Fails

Your system or network configuration does not allow Drupal to access web pages, resulting in reduced functionality. This could be due to your webserver configuration or PHP settings, and should be resolved in order to download information about available updates, fetch aggregator feeds, sign in via OpenID, or use other network-dependent services.

Read the rest of this entry »

WYSIWYG: The version of TinyMCE could not be detected

Sunday, February 21st, 2010

TinyMCE - Bug In WYSIWYG Drupal Module

TinyMCE - Bug In WYSIWYG Drupal Module

There is a bug currently in the WYSIWYG module for Drupal affecting TinyMCE which seems to be in the queue for patching into the stable release.
Read the rest of this entry »

PHP – Load Plain Text CSV Data Into MySQL / Convert CSV To MySQL

Tuesday, January 26th, 2010

The resulting MySQL table after loading CSV data into MyDQL

The resulting MySQL table after loading CSV data into MyDQL

For a while now, possibly like many other developers, I’ve been coding in PHP using CSV related functions such as fgetcsv() and explode(). This usually works out fine until you want to read data from a CSV file and the store the data inside a MySQL database. Using mysql_query inside a loop is not fun for your servers processor!

As usual, the best way to do things when it comes to PHP & MySQL is to wherever possible get MySQL to do most of the work. Here is an example PHP script for effectively converting a CSV format database into a MySQL table. It presumes you already have a working connection and have selected a database.

Read the rest of this entry »

Games