February 3rd, 2009 · PHP
I tried modifying this Zend_Form_Element_File example to support larger file uploads but noticed that I’ve been getting “Undefined index” errors when my uploads are bigger than 8MB.
Notice: Undefined index: tmp_name in C:\quickstart\library\Zend\File\Transfer\Adapter\Abstract.php on line 589
Notice: Undefined index: name in C:\quickstart\library\Zend\Validate\File\Size.php on line 398
Notice: Undefined index: tmp_name in C:\quickstart\library\Zend\File\Transfer\Adapter\Abstract.php on line 589
Notice: Undefined index: name in C:\quickstart\library\Zend\Validate\File\Extension.php on line 228
Being a PHP and Zend Framework newbie, I wanted to put the blame on Zend but in the end I found the reason for the upload and validation errors after much googling.
The solution requires updating two properties in php.ini:
upload_max_filesize = 32M
post_max_size = 32M
With these changes you can now upload relatively bigger files!
Just make sure that your hosting provider supports your file upload size settings.
Tags: php.ini·Zend Framework·Zend_Form_Element_File
January 29th, 2009 · PHP
Yesterday, I tried working on my first ever Wordpress plugin. It’s a simple filter which includes a Google Adsense script after every post.
I’m thinking of creating a Buy me a Coffee plugin next to take this plugin development challenge on to the next level.
Coincidentally, Matt just announced January 28 as the official Wordpress Thank a Plugin Developer Day.
Hopefully next year my plugins would be included in the next 4000 plugins for Wordpress.
But for now, I’d like to thank the developers of Google Sitemap Generator and Syntax Highlighter Plus for a job well done.
Keep up the good work you guys!
Tags: Sitemap·Syntax Highlighter·Wordpress Plugins
We’ve finally decided to get a reseller hosting space to accommodate our growing number of sites.
It’s quite pricey to get a hosting account for each site so we’re now getting one big space and divide it accordingly.
To help us with the initial costs of setting up the account, we’ve decided to offer the remaining space as a service with the following details:
50 pesos for 100 MB of space and 1GB of bandwidth per month (for static sites).
150 pesos for 150 MB of space and 1.5GB of bandwidth per month (good for blogs).
300 pesos for 500 MB of space and 5GB of bandwidth per month (for small businesses).
Supports both PHP 5 and MySQL 5.
This offer is limited to the Philippines on a “supplies last” basis.
One thing that we can guarantee you is that we will NOT oversell (which is a common practice of other cheap hosting providers).
For inquiries please call or text 02-416-8065 / 0917-785-2598 or drop us a line at [hello] AT <slingandstoneweb> DOT (com).
Tags: Sling and Stone Web·Web Hosting
For those interested in joining the IPhone development craze then this book might be the one for you.
You can get the eBook version from the Apress daily deal site for only $10 for the next 24 hours.

Tags: IPhone·Mac·Objective-C
I’ve had one of the weirdest problems last week when a friend reported that our newly designed navigation menu created in Flex was not working on her MacBook.
Basically, I had a couple of moving Flex Canvas’s where I attached mouse click events.
private function homeClicked(evt:MouseEvent):void {
getURL('/');
}
private function updatesClicked(evt:MouseEvent):void {
getURL('/category/updates');
}
private function storiesClicked(evt:MouseEvent):void {
getURL('/category/stories');
}
private function galleryClicked(evt:MouseEvent):void {
getURL('/category/gallery');
}
private function getURL(url:String):void {
var request:URLRequest;
request = new URLRequest(url);
navigateToURL((request), "_self");
}
We had no problems running this on IE, Firefox and Safari on Windows and Firefox on Ubuntu Linux so we got a little worried why it was not working properly on a Mac.
I initially thought that a popup blocker was probably causing the problem with navigateToURL() so I tried exploring changing the AllowScriptAccess parameter to “always” and use Flash/Flex’s support for calling ExternalInterface.
The animated Canvas’s also had rollover and rollout effects but they worked fine on all the mentioned platforms including Mac. So the problem must be with the Mac Flash Player not getting the mouse click events.
After several days of searching we discovered that the div where I placed our Flash object had a negative z-index declaration on its stylesheet which was getting in the way of Mac OS X’s Flash Player ability to receive mouse clicks.
I simply removed the z-index value and we finally got the links to work on those lovely little MacBooks.
Anyway, thanks to all my friends and their MacBooks for helping me with this very tricky problem.
Now we’re off to exploring PaperVision3D…
Tags: Flash Player·Flex·Mac OS X·navigateToURL·z-index
November 12th, 2008 · Books
Got an email today from Manning with the new sets of books due next year.
One of them was of particular interest, the
Website Owner’s manual
.
I’ve been a web developer for a number of years but mainly focusing on backend technologies.
So it goes without saying that I do not have much experience in managing a site.
The free chapter entitled: The Secret to a Successful Website discusses the crucial role of the site manager.
The book is still in “Early Access” phase and should be available early next year.
Tags: Manning·Web
September 26th, 2008 · Flex, Tools
It’s been a long time since I last played with Flex. I feel like starting from square one.
This also means that I have a more difficult path ahead of me, with my Flex Builder trial license already expired.
Fortunately, it’s not that hard to setup basic mxml auto complete functionality with a plain Eclipse installation with XML support.
First we need to define the .mxml file association in Eclipse (Preferences > General > Editors > File Associations).

Then map this file association to the XML editor (see screenshot below).

Add the Flex 3 schema (flex3.xsd) to Eclipse’s XML catalog.

Try creating a test mxml file and open it from Eclipse.
Test.mxml
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
</mx:Application>
You will most likely receive an Unsupported Type error.

Complete the process by adding the content type definition (shown below).

Close the mxml file and re-open. You should now be able to see the auto-complete functionality in action.

Hope this helps and let me know if you encounter any problems.
If you’re a student or a full time Flex developer, you shouldn’t even bother trying out the outlined steps.
Flex is free for students. But, if you make a living out of developing Flex apps, you might want to consider buying a license.
Related resources:
Tags: ActionScript 3·Adobe Flex·Eclipse·Eclipse Plugin·Flex Builder·MXML
September 19th, 2008 · PHP, Tools
I’ve been creating web applications for quite some time but never got interested in SEO (or Search Engine Optimization) until now.
The primary reason I think is that most (if not all) of the web applications I’ve been developing are for internal use only (think Java and banks).
But this outlook changed as my wife and I started playing with a Christian Music Site called Sling & Stone Music.
For starters, I’ve converted most of the dynamic URLs to use mod_rewrite to somehow make them search friendly.
I was thinking of buying a book for this purpose but luckily I found some very good articles from IBM developerWorks on the said topic.
Here are the links:
Hope you find them useful!
Tags: SEO
September 9th, 2008 · Tools
Being a *nix noob, I found it really hard to figure out the problem I had with a cron job last week.
The fact that sendmail was disabled in the machine I was working on also didn’t help (no emails were sent during failed cron task execution).
To workaround the problem, I found a useful tip from this post which enables console logging for cron.
add this line to /etc/syslog.conf
cron.debug /dev/console
I then got an error from the redirect logs which said:
sudo: sorry, you must have a tty to run sudo
This was easily fixed by commenting out the line below from /etc/sudoers (a tip from another blog post):
#Default requiretty
Hope this helps!
Tags: cron·sudoers
August 27th, 2008 · Tools
This morning I was browsing through the ads (using the Google Adsense Preview Tool) of Sling & Stone Music and noticed an interesting ad which had the title “Find Music by Singing“.
I’ve seen this ad pop up in our site before but this morning I decided to give it a try.
The results were astounding. Out of 10-15 songs/hums I did, only two of the results were incorrect.
Among the correct results were for Do-re-mi, ABC, Twinkle Twinkle Little Star, Voice of Truth, Flood, Complicated, Love Song for a Saviour, Tom’s Diner, Voltes V theme and a few others.
The two incorrect results were Bahay Kubo (unsurprisingly because it is a Filipino nursery rhyme) and Elvis’ Blue Suede Shoes (which I probably didn’t sing right).
It looks like a very promising site.
This is even better than Karaoke/Videoke!
Tags: Humming·Music·Singing