Create a Web Service using SOAP

This week one of the requirements for our client was to have a force.com application communicate with an external web service running on PHP to generate a barcode sequence. I’ll teach how I was able to setup the web service using NuSOAP and a document/literal as rcp/encoded is not supported by force.com. My goal was to make the task easier on php side so from force.com it would make a request by passing a string delimited by an asterisk and pipe. We process the string and return it back as url for the barcode image. I wont be covering barcode creation though in this tutorial but only the web service and sample client.
Read the rest of this entry »

Create rewrite rules for friendly url for WordPress plugin custom queries

I have this personal web application that was built from scratch last year and has already been considerably indexed by google. I used some Apache mod rewrite to make the urls friendly. Last week I decided it would be faster/easier to jumpstart the project again if I just focus on my application and just use a framework to handle other intracacies like abstractions, security and etc. I was aiming for CodeIgniter but got a glimpse on BuddyPress for WordPress(not a framework) which has most of the features I want for my app. So long story short I ended up porting my application to be a plugin for WordPress.

Read the rest of this entry »

Java SE Development (JDK) not found installing Android SDK

This is a simple tutorial for users with Vista/Windows 7 64-bit.

So you got Eclipse(Helios, Indigo) 64 bit running on your 64-bit machine and definitely you have Java SE Development and Jave Runtime Environment in check. But when you run the Andriod SDK installer you get this error.

Java SE Development (JDK) not found.

Android SDK relies on Java SE Development Kit(JDK)
Go to http://java.sun.com > Downloads > Java SE > JD to download and install a JDK before continuing.

Note: A Java Runtime (JRE) is not enought to develop for Android.

Well its a bug in the installer, for a simple solution simply hit the Back button and click on Next. Your JDK should be detected.

Eclipse PDT 32-bit on Windows 7

Recently I upgraded from Windows XP to Windows 7. Seems that the 32-bit and 64-bit architecture in regards to programs is still a bit confusing.

I’m using Eclipse PDT 32-bit which at the moment the only current all in one version. Can be downloaded here.
Read the rest of this entry »

Adding Server Preview Plugin on CKEditor 3.x version

If you were using the older FCKEditor online editor and got the Server Preview plugin working, you should know that the same plugin is not compatible with CKEditor. What Server Preview does is it allows you to preview content on a custom designed page you have be it an HTML, PHP or ASP page, giving you an idea how the page would look like with the content you are entering.

After scorching the net for on how to have Server Preview plugin work on CKEDitor some were a bit confusing, luckily somebody(vladfr) ported the script to work with CKEditor but he has no blog or site to document how it works I decided to create a straightforward tutorial on how to get Server Preview enabled on CKEditor.


Read the rest of this entry »

How to Setup PHP, MySQL and phpMyAdmin on Mac OS X Snow Leopard

My previous working setup was on WAMP( Windows, Apache, MySQL and PHP). On Windows I used a bundled app WampServer that did the job, just install the executable and your all set.

On Mac it kinda needs a bit of work but basically you have to configure PHP, download-install MySQL and phpMyAdmin.
Read the rest of this entry »

Godaddy Checkout Issue

I encountered a problem with Godaddy today when renewing a domain using my credit card which I have stored on Godaddy, suddenly I’m getting the  error

“There was a problem authorizing your credit. Please verify your payment information or use an alternate form of payment.”

After some googling I found out it is common on Paypal type of payment method, but I’m not using Paypal. After some more investigating I remember I paid for the domain before using Paypal but now I’m paying via card.  The domain is on auto renew for Paypal.

Follow the steps below for the fix.

1. Go to My Account
2. My Payment Information
3. Click on View all Renewing Items link
4. This should list all the domains you have purchased with columns like Reciept, Next Billing date, and Auto
5. If the domain you are trying to renew is on Auto on: You would see the mode of payment either Paypal: username or the card version Visa: #####
7. Select the checkbox of the domain you are renewing and hit Update Payment Option
8. On Change Payment Type choose Select From Existing and choose your card then Save.
That should be it, go back to the checkout for your shopping cart and you should be able to purchase/renew without the error.
Hope this helps.

Ajax caching issue with IE workaround

If you’ve been developing websites I’m sure you pretty feel a little nausea from browser refreshing after an operation and prefer to work with AJAX for updating, deleting or loading some data from your DB with out the page reloading.

Most commonly used is http request is GET, your script runs flawlessly with Firefox, Chrome and Safari however on IE7 & and IE8 you don’t see the updates. This is because IE 7 and IE 8 treat GET request differently than POST, if there is no change from the last call it will always load up from it’s cache.

The workaround to the issue is pass an ever changing variable to the GET request like the current timestamp or date.

1. You can pass it on the ajax function call by adding an extra parameter time on the ajax call on the page.

ajaxify(x,<?php echo time(); ?>); // ajaxify(keywords, rand_time)

Then on your ajax function xmlHttp request call the rand_time parameter

xmlHttp.open(“GET”,”includes/ajax_page.php?dontcacheme=” + rand_time +”&keywords=”+keywords,true);

2. Or just create the random string using a Javascript Date class.

xmlHttp.open(“GET”,”includes/ajax_page.php?dontcacheme=” + new Date().getTime() +”&keywords=”+keywords,true);

This workaround worked well with my ajax scripts. Hope it helps.

PHP Certified Developers

I’ve been preparing for the past few months to take the Zend certification for PHP. However I’ve been busy as well with client projects but I plan to take it this year. Here is an interesting chart on the growth of PHP Certified Developers through the years. The growth of PHP developers have been phenomenal due to developing applications on open source environment LAMP(Linux, Apache, MySQL and PHP) has always been cheaper alternative, but with the numbers of PHP developers growing there has not been a significant growth for those getting themselves PHP certified.

Here is a slide chart courtesy from a research made by Prof. Mauricio Garcia F. Nascimento from Sao Paulo

certified-php-experts

With the U.S. leading with 1,047 PHP Certified Developers based on 2009.

And from 2004-2008 only 15 are PHP Certified from the Philippines. I want to belong in that company soon this year. So back to studying again.

Access denied for user root@’localhost’ (using password: NO)

Been using WAMP for several months now and once in awhile MySQL breaks. Somehow the user tables gets corrupted. To fix the problem instead of reinstalling the whole WAMP. Just replace the corrupted files. These 3 files are always corrupted.

      user.MYI
      user.MYD
      user.frm

Download this mysqlusertables. Unzip the file, copy the 3 files inside.

Go into your C:\wamp\bin\mysql\mysql5.x.xx\data\mysql directory and paste, click yes to overwrite.

Restart All Service on your WAMP. Then you are good to go.

I’ll keep you posted soon on why these tables easily gets corrupted.

*Update*

Digging deeper to the culprit I found out the tables for users in the mysql db has warnings, meaning they are corrupt. So to avoid doing the steps above while your MySQL and phpMyAdmin is still working. Go to phpMyAdmin, access mysql db, then select users table then click on operations then under “Table maintenance” click on Repair Table. Viola!!!