2009/07/16

Amazon S3 upload issue

I got this error when I try to upload file to Amazon using S3.php library.

Amazon S3 Server.RequestTimeTooSkewed(403): The difference between the request time and the current time is too large.

The problem is that the developer box was down in the past few days. It is up now, but the date time is wrong.

Here is a solution:

ntpdate pool.ntp.org

2009/07/07

Call Member function

PHP5 is OO language. For a basic usage, we may not need to understand the concept of OO design in details, so sometimes we may forget how to call a member function defined in a Class. :-(

Got this error this morning:

PHP Fatal error:  Call to undefined function get_tokens()

Haha!

The solution:

$this->get_tokens();

Remember to you must have $this-> to call a member function defined in a Class.

2009/07/01

Permission denied to get property HTMLDivElement.parentNode

pForm is cool, and I just used it to build a form yesterday. But it worked fine yesterday, but this morning, when I when tried to select the date from Date field, I got this error message:

Permission denied to get property HTMLDivElement.parentNode

pForm integrated the calendar.js developed by Dynarch.com, seems this is a bug of firefox . Here is a quick fix. Open calendar.js at line 131 in the code. Add try and catch like below,

Calendar.isRelated = function (el, evt) {
   var related = evt.relatedTarget;try{
   if (!related) {
      var type = evt.type;
      if (type == "mouseover") {
         related = evt.fromElement;
      } else if (type == "mouseout") {
         related = evt.toElement;
      }
   }
   while (related) {
      if (related == el) {
         return true;
      }
      related = related.parentNode;
   }
   return false;
   }catch(e){
      return;
   }
};