Google+ share button popup error Claimed origin not in whitelist

August 25, 2014

Your web origin in the Google API Console should only include http:// or https:// and then the host name. Make sure you don’t have / in the end. The web origin is under the OAuth 2.0 Client ID section in the Console. Remove the ‘/’ at the end of “Javascript Origins” url and solve Example: […]

PHP Cybersource Merchant supplied signature does not match generated signature

August 22, 2014

When this error occur, it means the signed data fields doesn’t matched the supplied post form field or is being left empty. To solve this, make sure each signed data fields are filled up not empty. The PHP sample of Simple Order API & SOAP Toolkit API can be downloaded from here Or refer to […]

Cybersource you are not authorized to view this page. the transaction has not been processed

August 22, 2014

Determine if transaction reaches the gateway. 1. Log into the CyberSource Business Center 2. Navigate to Transaction Search > Secure Acceptance Search. 3. Search for recent activity, If you do not find transaction activity: This means that an authentication failure occurred. To correct this, verify that your Access Key, Secret Key and/or Profile ID with […]

jQuery get which radio is selected

August 22, 2014

Use the :checked selector along with the radio selector. With form id, can do this Without form is, it will still work:

AWS Use of undefined constant CURLE_COULDNT_RESOLVE_HOST

August 22, 2014

It appears that you are missing curl. If you are linux you can usually install it via the package manager package would be named something similar to php-curl. If windows, enable the curl extension in php.ini To check if curl installed in php, you may create a phpinfo.php file in your server root and run […]

Ubuntu phpmyadmin connect to mysql error: #2002 cannot log in to the mysql server

August 22, 2014

If phpmyadmin cannot connect to mysql error: #2002 cannot log in to the mysql server Run: sudo nano /etc/mysql/my.cnf Update bind-address = 192.168.0.2 To bind-address = localhost This fixed the problem. Enjoy. ref: here

Ubuntu 10.04.4 upgrade php 5.3.2 to 5.3.6

August 22, 2014

For anyone who wants to upgrade Ubuntu 10.04 LTS to PHP 5.3.10, this is how I have done it. Note sudo apt-add-repository ppa:brianmercer/php5 doesn’t work anymore. Suspect has been taken down. sudo apt-add-repository ppa:brianmercer/php5 will not work anymore However the steps below do work!! sudo add-apt-repository ppa:bjori/php5 sudo apt-get update sudo aptitude show php5 Package: […]

PHP get first key in associative array

August 7, 2014

If efficiency is not that important can use array_keys($yourArray)[0] in PHP 5.4 (and higher). Output: a

jQuery handle null value in PHP variable or array

August 6, 2014

Handling php array or variable inside javascript directly using json_encode, will result some value null. To check null using jquery in this case:

jQuery select list set selected using php variable

August 6, 2014

Using jQuery to set the selected element of the select control to be the item with the text description. Value from php.