Category Archives: Web Programming

It is not safe to rely on the system’s timezone settings

Recently I have been having the following error on my PHP code every time I call the PHP function date();  Mostly when running it on my local test server.

Warning: date(): It is not safe to rely on the system’s timezone settings

Cause: Since PHP5.1.0 the E_RESTRICT setting causes PHP to report error for every call
to a date/time function, if no default time is set.

There are 2 approaches to  resolving this.

  1. Set time setting to your PHP script with the function date_default_timezone_set();  with the intended time zone/location eg: for GMT one can use date_default_timezone_set(‘Europe/London’);
  2. Set time setting to your php.ini file by editing the line ;date.timezone = to date.timezone = “Europe/London” or you required location. This is good for setting a server wide time setting.

Technorati Tags: , , , , ,

Firefox Add-on Collector

Now you can have a list of your favourite Firefox Add-ons to share. I have always tried to keep a list in my bookmarks of the Add-ons I find most useful and normally recommend to people, now life has become much easier.

Discover more of the best add-ons and organize your favourites in easy-to-manage collections. Subscribe to see how the collections you admire grow, and fans follow when you manage and update your own collections with Mozilla Firefox Add-on Collector.

You can have a look at my small collection at

Technorati Tags: , , , , , ,

Error 1062 – Duplicate entry ‘2147483647’ for key 1

CRE Loaded was giving me the error  1062 – Duplicate entry ‘2147483647’ for key 1 – when trying to add a new product.

Cause: for some unexplained reason the auto_increment ID field on Table “products” has gone up to 2147483647 which is apparently the maximum number of rows permitted in an INT column.


  1. Go to your phpMyadmin interface
  2. Backup your database (make sure you know how to restore it if needed)
  3. Browse the products table (select to sort the fields by Descending order)
  4. The top item should now have the ID = 2147483647
  5. Change the ID to a number up from the previous item (e.g.: Previous was ID = 301, than change the ID = 2147483647 to 302)
  6. Repeat same process with table “product_to_categories”
  7. Return to table “products”
  8. Select the SQL tab
  9. run the following SQL Query :  ALTER TABLE products AUTO_INCREMENT=303   (note that 303 is the next number up from the example on step 5, you should use the next number up in your situation)

It worked perfectly for me, hope this helps.

Technorati Tags: , , , ,

Keyword search and website ranking tools

Any webmaster and marketer will know how important it is to keep track of their website ranking, keyword positioning, visits, ROI and so on…  There are a lot of interesting tools out there to help us. 

  • Google Analytics – Visitor tracking, keyword positioning, goal setting, demographics and more…
  • – web traffic metrics, top sites lists, site demographics, hot urls, and more… 
  • Google Webmaster Tools – detailed reports about your pages’ visibility on Google
  • Yahoo Site Explorer – detailed reports about your pages’ visibility on Yahoo
  • Bling Webmaster Center – detailed reports about your pages’ visibility on Bling (former LiveSearch)
  • Keyword Spy – Research and track keywords in 3 search engines and 30+ countries.
  • KPMRSwebsite rank monitoring services on various search engines
    for multiple keywords.
  • XML-Sitemaps – Generate sitemaps online. Up to 500 urls Free.
  • WP Google XML Sitemaps – This plugin will create a Google sitemaps compliant XML-Sitemap of your WordPress blog.

These are just a few tools I use the most, please share yours.

Technorati Tags: , , , , , , , , , , , , ,

Automatically display form data with PHP

This is a simple PHP  script to automatically display (dump output)  data submited from a html form.

The form setup

  • all inputs (form fields) need to have the same name with [] at the end to turn it into an array,  e.g <input type=text name=formdata[]>

formq.html content

<form method=post action=showme.php>
Name: <input type=text name=formdata[]><br>
Email: <input type=text name=formdata[]><br>

<input type=submit value=ok>

The Script setup

showme.php content

$data = $_POST[‘formdata’]; # get value from the form fields

foreach ( $data as $key => $value ) { # loop through array collecting the results

echo  “$value<br>”;  # output the data  – print to page

Technorati Tags: , , , ,