Links to download PHP library and frameworks and open sources

Download PHP Library (Core)


Download PHP Frameworks
Download PHP Open-sources

Amazon simple pay generate button

How to integrate Amazon Simple Pay Standard Buttons for Payment?


Amazon Simple Pay allows your customers to use payment information from their account as a payment method on your website.


You can use Amazon Simple Pay to enable payments, donations, subscriptions, and marketplace transactions. It provides easy-to-configure, cut and paste HTML code and buttons for your business needs.


You can also create buttons dynamically, here is the code, I am attaching with post, hope this will help you to integrate.


Setup Instructions

  1. If you don’t have an Amazon Payments business account, sign up for one here
  2. Follow the instructions they provide, including confirming your email address, and adding a bank account.
  3. Go to the Amazon Web Services website
  4.  Login. If it is your first time using AWS, you will be prompted to create a new account.
  5. Click the Account tab, and then click the Security Credentials link.
    Copy the Access Key ID and the Secret Access Key (or write down them carefully!) These will require in the code later.


Download the code from below link


You can also found the same code from amazon website by the link below.


Hope the above save your time to integrate AMAZON SIMPLE PAY in your Shopping Cart web application.

Parse your character data using CDATA section

XML parser normally parse all the text in an XML document.


Characters such as less than (<), greater than(>), ampersands(&) etc cause problems for the XML processor/parser.


“<” parser interprets it as the start of a new element.
“&” parser interprets it as the start of an character entity.
JavaScriptcode,contains a lot of “<” or “&” characters.To avoid errors script code can be defined as CDATA.


CDATA section tell the parser that there is no markup in the characters contained by the CDATA section
Parsed character data (PCDATA) is a term used about text data that will be parsed by the XML parser.
CDATA is used for (Unparsed) character data.


A CDATA section starts with “<![CDATA[” and ends with “]]>”

example :
function function_name()
if (condition1 && condition2) {
return 1;
}else {
return 0;


A CDATA section is also required if you are using XHTML and validating it, as XHTML will parse the JavaScript code as parsed character data as opposed to character data by default. This is not an issue with scripts that are stored in external source files(.js file),but for any inline JavaScript in XHTML ,it will better to use in a CDATA section.


..your code will go here..


Notes :

  • Nested CDATA sections are not allowed.
  • A CDATA section cannot contain the string “]]>”.
  • The “]]>” (end of the CDATA section) cannot contain spaces/line breaks.


Google Maps: Easy Way to Find Latitude and Longitude Values of a Place in Google Maps

If you are playing with Google Maps, and want to get Latitude and Longitude of any location on Earth no worries.
Follow below few simple steps to go.

[code lang=”js”]
<script type="text/javascript" src=""></script>


[code lang=”js”]
<div class="Mapblock">
<div style="height:auto;">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<div id="map" align="center" style="height: 276px;width:276px;border: 1px solid #DDDDDD; font-size:12px; font-weight:normal; color:#000000;"></div>

<script type="text/javascript">

if( window.addEventListener )
window.addEventListener( ‘load’, load, false );
window.attachEvent( ‘onload’, load );

function load() {

var map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());

map.setCenter(new GLatLng(27.137368,75.761718), 5);
var marker = new GMarker(new GLatLng(37.4419, -122.1419), {draggable: true});

GEvent.addListener(map, ‘click’, function(overlay, point) {
var; //alert(lati);
var long=point.lng(); //alert(lati);
var marker= new GMarker(new GLatLng(lati, long),{draggable: true});

GEvent.addListener(marker, "dragend", function() {
var point = marker.getPoint();
var long=point.lng();

GEvent.addListener(map, ‘singlerightclick’, function(point,src,overlay)
if(overlay != marker) { map.removeOverlay(overlay) }




  1. Get google map key.You can get from the below link of Google Map.Here I am using version2,in version3 of google map,we don’t need key.
  2. Replace GOOGLE_MAP_KEY with your google map key.
  3. Copy and paste the script in your code.
  4. Set the center of the map (Default center) by replacing the respective Latitude and Longitude.

[code lang=”js”]map.setCenter(new GLatLng(27.137368,75.761718), 5);[/code]


Here number 5 is zoom level,you can set this one also.


  1. Run the code.
  2. Click on any point on the map,a popup will automatically show up with the respective Latitude and Longitude(co-ordinates) of that point.
  3. If you want to discard it,don’t worry,just right click on the google map marker.


Software Development Life Cycle

Software Development Life Cycle Phases


SDLC(Software Development Life Cycle) is a conceptual model or a detailed plan on how to create, develop, implement and launch the software, it describes the stages involved in an information system development project.


There are six steps or stages of SDLC.


1. System Requirements Analysis
2. Feasibility study
3. Systems Analysis & Design
4. Code Generation
5. Testing
6. Maintenance


System Requirements Analysis

This stage includes a detailed study of the business needs of the application. Design focuses on high level design like, what programs are needed and how are they going to use,

Low-level design (How the individual programs are going to work?)
Interface design(What are the interfaces going to look like?)
Data design(what data will be required?)

Analysis and Design are very crucial in the whole development cycle. Much care must be taken during this phase.


Feasibility Study

The feasibility study is used to determine if the project should get the go-ahead and well-defined the scope of project will prepared. If the project is to proceed, the feasibility study will produce a project plan and budget estimates for the future stages of development.


Systems Analysis and Design

Here analysis is made on the design of the system that is going to be developed. In other words database design, the design of the architecture(frame works) chosen, functional specification design, low level design documents, high level design documents (SRS) and so on takes place. Care must be taken to prepare these design documents because the next phases namely the development phase is based on these documents & design.


Code Generation or Implementation

In this phase the designs are translated into code. Computer programs are written using a conventional programming language. Different high level programming languages like C, C++, PHP, Java are used for coding. With respect to the type of application, the right programming language is chosen to reduce the time and cost.



In this phase the application is tested. Normally programs are written as a series of individual modules, these subject to separate and detailed test or module test. The system is then tested as a whole. The separate modules are brought together and tested as a complete system. A software or system which is not tested would be treated as poor quality.


Maintenance & Enhancement

Application will need maintenance. Software will definitely undergo change once it is delivered to the end-customer. There may many reasons for the change, change could happen because of some unexpected input values into the system or addition of some functionality into the system. The software should be developed to accommodate changes.


PHP timezone setting using date_default_timezone_set function

If you have hosted your website on a server that is not in the same time zone as you live. In the old days of PHP3 & PHP4, we would write a time_offset function or something like that to roll back or add the necessary hours to get the time correct for your own use (hard stuff).


Since PHP 5.1.0, you have the function date_default_timezone_set() available. One simply needs to call this with your own timezone at the top of their PHP file, that’s all.


date_default_timezone_set function sets the default timezone used by all date/time functions in script.
The function returns boolean value, false if the timezone_identifier isn’t valid, otherwise true.


you can get the valid timezones by click here



bool date_default_timezone_set ( string $timezone_identifier )

It is notable that default timezone can also be set by using php.ini setting date.timezone directive.
The timezone_identifier refers to the Coordinated Universal Time (UTC) or Greenwich Mean Time (GMT) or region based time like India/Kolkata.

You might need to restart your web server for the changes to take effect if you choose this one.


If you want to set timezone using .htaccess here is way you can go

php_value date.timezone “India/Kolkata”




if (date_default_timezone_get()) {
echo ‘date_default_timezone_set: ‘ . date_default_timezone_get() . ‘<br />’;

if (ini_get(‘date.timezone’)) {
echo ‘date.timezone: ‘ . ini_get(‘date.timezone’);




Guys, post me comments if you found above one script is not working and want to improve the above!!