Implement Google Calendar in Your Website


For one of my project I need to implement Google Event Calendar in my CMS. First time I thought its may be complicated. But its not. See this:

Step1: First you need a Google service account. If you already have Google account for Gmail or any other Google service then you can use that account ID, in that case you do not need any new account.

Step2: Login to Google Calendar by this

Step3: After login you will see a default event calendar according to your account ID. To navigate other or create a new calendar go to screen left side My Calendars Panel Box. For create new calendar, click on create. For navigate other calendar you have to click on any one from the list of all your calendars. From list select your preferred calendar. After select your preferred calendar navigate to the calendar settings by click on small array. After click on small array you will see a drop down list. Click on Calendar Settings. You will see your preferred calendar settings. Here also you will see a block with titled Embed This Calendar. Copy the iframe code from here and paste the code on you required CMS page. All done.
[Note: Dont forget to set you calendar public from calendar settings, to access the calendar without login.]


Status Code in HTTP, Internet Explorer Version


After two another post on this, I think I need to post an Internet Explorer Version of Status Code. See the followings:

52 Runtime Error
This is a “bad file name or number” error in JavaScript.

It means that the script cannot find a file it is looking for (web-page, course component) and is most likely a connectivity problem.

Try to clear your temporary internet files which should resolve any further problems… If this does not then speak with the website administrator as there may be a problem with the websites server.

400 Bad File Request
Usually means the syntax used in the url is incorrect (e.g. uppercase letter should be lowercase letter; wrong punctuation marks)

401 Unauthorised
The website server is looking for some encryption key(s) from the client (your computer) and is not getting it. Also, a wrong password may have been entered. Try it again, paying close attention to case sensitivity..

403 Forbidden/Access Denied
Similar to 401, special permission is needed to access the website A password and/or username may not be correctly registered on the websites database. Other times the website server may not have the proper permissions set up on its directories…

404 File Not Found
Server cannot find the file you requested. Refreshing the page (F5) should resolve this problem, although continued error messages may mean the page is no longer available, that there is considerable internet congestion (in which case the user should try again later).

Alternatively the file could have been either been moved or deleted, or you entered the wrong URL or document name. Look at the URL. If a word looks misspelled, correct it and try it again. If that doesn’t work backtrack by deleting information between each backslash, until you come to a page on that site that isn’t a 404.

From there you may be able to find the page you’re looking for. This has to be the most common Internet Explorer Error message on the Internet!

408 Request Timeout
Client (your computer) stopped the request before the server finished retrieving it. A user will either hit the stop button, close the browser, or click on a link before the page loads. Usually occurs when servers are slow or file sizes are large.

500 Internal Error

Couldn’t retrieve the HTML document because of server-configuration problems.

Contact website administrator…

501 Not Implemented
Web server doesn’t support a requested feature.

502 Service Temporarily Overloaded
Server congestion; too many connections; high traffic. Keep trying until the page loads. This can be a common occurrence at peak news times eg. the Twin Towers during September 2001 brought CNN and the BBC news sites to a slow crawl and many folks got this error.

503 Service Unavailable
Server busy, site may have moved, or you lost your dial-up Internet connection!

Bad File Request
Browser may not support the form or other coding you’re trying to access.

Connection Refused by Host
Either you do not have permission to access the site or your password is incorrect. Try again!

Errors on Page
This error message is a catch-all statement meaning there is something on the web page that the browser either hasn’t read properly (connectivity problem) or there are missing items in the web page itself. This problem normally affects the graphics on a web page.

This can be a temporary glitch (caused by insufficient bandwidth), and may be quickly resolved, or it can have a more complex and longer term problem. With regard to most cases of this Internet Explorer Error message, it is due to not having given sufficient time to download the page you are requesting.

It is necessary to wait until the bottom left hand corner of the page reads ‘done’ before selecting any other links on the page to move forward.

Failed DNS Lookup
The Domain Name Server can’t translate your domain request into a valid Internet address. The website server may be busy or down, or incorrect url (web address) was entered.

File Contains No Data
Page is there but is not showing anything. Error occurs in the document. Attributed to bad table formatting, or stripped header information….

Host Unavailable
Host server down. Hit reload or go to the site later

Network Connection Refused by the Server
The Web server is busy. To resolve this problem, refresh the page. (Press Ctrl and F5).

Runtime Error
(The information in this solution applies to: Internet Explorer 5.5 (SP1) 95 / 98 / 98 Second Edition / NT4.0 / 2000). When you attempt to browse to various websites, you may receive an error message similar to the following ‘A runtime error has occurred. Do you wish to debug? Line number Error: Permission Denied.’

This can occur if you upgrade to IE 5.5 (SP1). The upgrade enables the script-debugging and script-error-notification options. (Note: Because there are several versions of Windows, the following steps may be different on your computer. If they are, please consult your product documentation to complete these steps:)

To resolve this issue, disable the script-debugging and script-error-notification options. To do this, follow these steps:

1. Start Internet Explorer.
2. On the Tools menu, click Internet Options.
3. Click the Advanced tab .
4. Click to select the Disable script debugging check box .
5. Click to clear the Display a notification about every script error check box .
6. Click Apply, and then click OK.
Fortunately this is a very rare Internet Explorer Error message…

Script Error
Script errors are caused when something goes wrong when surfing some web pages. It is caused by VBScript or JavaScript code that is embedded within certain web pages. These errors are mostly due to connectivity problems, though can occasionally be caused by browser incompatibilities. Ensure that you have a compatible browser version (IE 5.5 and above or Netscape 4.76 and above).

Unable to Locate Host
Host server is down, Internet connection is lost, or URL typed incorrectly.

If refreshing the page doesn’t work, try clearing the Temporary Internet Files and History and refreshing again. You may have to wait until later.

Status Code in HTTP, Also known as Browser error Code – 2


This is second post on Status Code. I have another one post on this, see this

Followings are codes and their details :

Success 2xx
These codes indicate success. The body section if present is the object returned by the request. It is a MIME format object. It is in MIME format, and may only be in text/plain, text/html or one fo the formats specified as acceptable in the request.

OK 200
The request was fulfilled.

Following a POST command, this indicates success, but the textual part of the response line indicates the URI by which the newly created document should be known.

Accepted 202
The request has been accepted for processing, but the processing has not been completed. The request may or may not eventually be acted upon, as it may be disallowed when processing actually takes place. there is no facility for status returns from asynchronous operations such as this.

Partial Information 203
When received in the response to a GET command, this indicates that the returned metainformation is not a definitive set of the object from a server with a copy of the object, but is from a private overlaid web. This may include annotation information about the object, for example.

No Response 204
Server has received the request but there is no information to send back, and the client should stay in the same document view. This is mainly to allow input for scripts without changing the document at the same time.

Error 4xx, 5xx
The 4xx codes are intended for cases in which the client seems to have erred, and the 5xx codes for the cases in which the server is aware that the server has erred. It is impossible to distinguish these cases in general, so the difference is only informational.

The body section may contain a document describing the error in human readable form. The document is in MIME format, and may only be in text/plain, text/html or one for the formats specified as acceptable in the request.

Bad request 400
The request had bad syntax or was inherently impossible to be satisfied.

Unauthorized 401
The parameter to this message gives a specification of authorization schemes which are acceptable. The client should retry the request with a suitable Authorization header.

PaymentRequired 402
The parameter to this message gives a specification of charging schemes acceptable. The client may retry the request with a suitable ChargeTo header.

Forbidden 403
The request is for something forbidden. Authorization will not help.

Not found 404
The server has not found anything matching the URI given

Internal Error 500
The server encountered an unexpected condition which prevented it from fulfilling the request.

Not implemented 501
The server does not support the facility required.

Service temporarily overloaded 502 (TO BE DISCUSSED)
The server cannot process the request due to a high load (whether HTTP servicing or other requests). The implication is that this is a temporary condition which maybe alleviated at other times.

Gateway timeout 503 (TO BE DISCUSSED)
This is equivalent to Internal Error 500, but in the case of a server which is in turn accessing some other service, this indicates that the respose from the other service did not return within a time that the gateway was prepared to wait. As from the point of view of the clientand the HTTP transaction the other service is hidden within the server, this maybe treated identically to Internal error 500, but has more diagnostic value.

Note: The 502 and 503 codes are new and for discussion, September 19, 1994

Redirection 3xx
The codes in this section indicate action to be taken (normally automatically) by the client in order to fulfill the request.

Moved 301
The data requested has been assigned a new URI, the change is permanent. (N.B. this is an optimisation, which must, pragmatically, be included in this definition. Browsers with link editing capabiliy should automatically relink to the new reference, where possible)

The response contains one or more header lines of the form

URI: String CrLf

Which specify alternative addresses for the object in question. The String is an optional comment field. If the response is to indicate a set of variants which each correspond to the requested URI, then the multipart/alternative wrapping may be used to distinguish different sets

Found 302
The data requested actually resides under a different URL, however, the redirection may be altered on occasion (when making links to these kinds of document, the browser should default to using the Udi of the redirection document, but have the option of linking to the final document) as for “Forward”.

The response format is the same as for Moved .

Method 303

Note: This status code is to be specified in more detail. For the moment it is for discussion only.

Like the found response, this suggests that the client go try another network address. In this case, a different method may be used too, rather than GET.

The body-section contains the parameters to be used for the method. This allows a document to be a pointer to a complex query operation.

The body may be preceded by the following additional fields as listed.

Not Modified 304
If the client has done a conditional GET and access is allowed, but the document has not been modified since the date and time specified in If-Modified-Since field, the server responds with a 304 status code and does not send the document body to the client.

Response headers are as if the client had sent a HEAD request, but limited to only those headers which make sense in this context. This means only headers that are relevant to cache managers and which may have changed independently of the document’s Last-Modified date. Examples include Date , Server and Expires .

The purpose of this feature is to allow efficient updates of local cache information (including relevant metainformation) without requiring the overhead of multiple HTTP requests (e.g. a HEAD followed by a GET) and minimizing the transmittal of information already known by the requesting client (usually a caching proxy).

Status Code in HTTP, Also known as Browser error Code


I have another post on the topic. Now read this. Followings are response codes and their short details :

200 : The request completed successfully.
201 : The request has been fulfilled and resulted in the creation of a new resource
202 : The request has been accepted for processing , but the processing has not been completed
203 : The returned meta information in the entity-header is not the definitive set available from the origin server.
204 : The server has fulfilled the request, but there is no new information to send back.
205 : The request has been completed, and the client program should reset the document view that caused
the request to be sent to allow the user to easily initiate another input action.
206 : The server has fulfilled the partial GET request for the resource.
300 : The server couldn’t decide what to return.
301 : The requested resource has been assigned to a new permanent URI, and any future references
to this resource should be done using one of the returned URIs.
302 : The requested resource resides temporarily under a different URI.
303 : The response to the request can be found under a different URI and should be retrieved
using a GET method on that resource.
304 : The requested resource has not been modified.
305 : The requested resource must be accessed through the proxy given by the location field.
307 : The redirected request keeps the same verb. HTTP/1.1 behavior.
400 : The request could not be processed by the server due to invalid syntax.
401 : The requested resource requires user authentication.
402 : Not currently implemented in the HTTP protocol.
403 : The server understood the request, but is refusing to fulfill it.
404 : The server has not found anything matching the requested URI.
405 : The method used is not allowed.
406 : No responses acceptable to the client were found.
407 : Proxy authentication required.
408 : The server timed out waiting for the request.
409 : The request could not be completed due to a conflict with the current state of the
resource. The user should resubmit with more information.
410 : The requested resource is no longer available at the server, and no forwarding address is known.
411 : The server refuses to accept the request without a defined content length.
412 : The precondition given in one or more of the request header fields evaluated to false
when it was tested on the server.
413 : The server is refusing to process a request because the request entity is larger than the
server is willing or able to process.
414 : The server is refusing to service the request because the request URI is longer than the server
is willing to interpret.
415 : The server is refusing to service the request because the entity of the request is in a format
not supported by the requested resource for the requested method.
500 : The server encountered an unexpected condition that prevented it from fulfilling the request.
501 : The server does not support the functionality required to fulfill the request.
502 : The server, while acting as a gateway or proxy, received an invalid response from the upstream
server it accessed in attempting to fulfill the request.
503 : The service is temporarily overloaded.
504 : The request was timed out waiting for a gateway.
505 : The server does not support, or refuses to support, the HTTP protocol version that
was used in the request message.


Paypal Integration Using Codeigniter – Phase:1


Paypal is one papular e-payment gateway and there are different types of API or way to integrate Paypal in your site. Most of us implement the PayPal package Website Payment Standard on our website. It is the process where user payment handled on PayPal website instead of seller website. I implement a process where user buy different products and all selected product show in my wesite cart also in PayPal Cart (multiproducts show on PayPal) and pay on paypal website. Then user redirect to my website with some post data necessary for database entry (back office process for order tracking) in my site. On the phase I will discuss, how to make a codeigniter controller for send request to paypal website. This phase also include paypal form creation, send request to paypal, show data on paypal cart, and all prerequisite need to integrate the gateway.

First of all we need to make a form that send data to paypal website. There are different discussion about that how make a form, and all are the same discussions. Everybody omit some essential issues as below :

  1. Need to create PayPal Sandbox account by developer (It need for create environment of dummy transaction)
  2. Forget to configure some essential value for successful test transaction (Discuss in future)
  3. Need to discuss how to send multiproduct list to paypal (Show Paypal Cart on Paypal page)
  4. How codeigniter create PayPal Request Form

(i) First we need to create paypal test account known as sandbox account on paypal. Go to here and create a test/developer account. Then create demo Sellers and Buyer account for live experience of dummy transaction. You can get different tutorial how to do that on Google. After create all account make a note of your buyer and seller email and password by notepad that you just created on paypal. In future you will need to set the seller/marcent email on paypal request form and you will enter the buyer email when redirect to PayPal site for pay. When you finish, go to the next step.

(ii) Now we will create a form for send request to paypal website. For minimize our development task we implement a well known PayPal library download from here . Place all files to specific location. Load the PayPal library on your request controller that create the PayPal Form. I have write the following code on my controller to make a PayPal Form by a view page.

// Generate Paypal Request Form
// By the Function Create Payment Processing Form And Submit a Pending Order to our MySQL database
function create_paypal_form()
$orderarr = array();
* Get post data/order details from ckeckout request form to send
* PayPal and and to add database for order process start
// Get all the products ID by comma(') saperated from Shopping Cart
$setpaypal_prodid = $this->input->post('getpaypal_prodid');
// Get all the products name by comma(') saperated from Shopping Cart
$setpaypal_prodname = $this->input->post('getpaypal_prodname');
// Get all the products quentities by comma(') saperated from Shopping Cart
$setpaypal_totlqunt = $this->input->post('getpaypal_totlqunt');
// Get he total price value from Shopping Cart
$setpaypal_totlprice = $this->input->post('getpaypal_totlprice');
// Get all the subtotal prices of products/items by comma(') saperated from Shopping Cart
$setpaypal_itemprice = $this->input->post('getpaypal_itemprice');
//Get splited products IDs from comma(') saperated products IDs
$paypal_id_array = explode('|',$setpaypal_prodid);
//Get splited products name from comma(') saperated products name
$paypal_prod_array = explode('|',$setpaypal_prodname);
//Get splited products quentities from comma(') saperated products quentities
$paypal_qunt_array = explode('|',$setpaypal_totlqunt);
//Get splited subtotal prices from comma(') saperatedsubtotal prices
$paypal_price_array = explode('|', $setpaypal_itemprice);
* Initialize & Submit Order to DATABASE Before Pass to Paypal Payment Gateway
$orderarr['set_order_date'] = time();
$orderarr['set_order_item_id'] = $setpaypal_prodid;
$orderarr['set_order_item_name'] = $setpaypal_prodname;
$orderarr['set_order_totl_price'] = $setpaypal_totlprice;
$orderarr['set_order_item_qunt'] = $setpaypal_totlqunt;
$orderarr['set_item_summery_id'] = $setpaypal_summid;
$orderarr['set_order_status'] = "Pending";
$orderarr['set_order_transaction_id'] = "";
$orderarr['set_order_transaction_status'] = "Not Start";
$orderarr['set_order_shipto_id'] = "";
$orderarr['set_order_member_id'] = $this->session->userdata('member_id');
$orderarr['set_order_member_email'] = $this->session->userdata('member_userid_email');
$orderarr['set_delete_flag'] = '0';
Configure Basic Setup for Payment Request Form
$result_paypal_business_accemail = $this->orderprocessing_model->get_paypal_acc('Paypal');
// "seller_email" is a table fieldname, on that table we store all paypal marcent information
$set_paypal_business_accemail = $result_paypal_business_accemail[0]->seller_email;
// If we want to show user cart also on PayPal site then we use this
// In that case we send multiple products to PayPal site
$this->paypal_lib->add_field('cmd', '_cart');
// Use value 1 for this
$this->paypal_lib->add_field('upload', '1');
// This is marcent/seller business email, we use our sandbox business email that create early
$this->paypal_lib->add_field('business', $paypal_business_acc );
// This is success page URL, in our case(MVC) we set there a controller URI
//here paypal is a controller & success is a method
$this->paypal_lib->add_field('return', site_url('paypal/success'));
// This is cancle page URL, in our case(MVC) we set there a controller URI
//here paypal is a controller & cancle is a method
$this->paypal_lib->add_field('cancel_return', site_url('paypal/cancel'));
// This is paypal notification page URL, in our case(MVC) we set there a controller URI
//here paypal is a controller & ipn is a method
$this->paypal_lib->add_field('notify_url', site_url('paypal/ipn'));
// This is Currency Code, never send symbolic code like $, #
$this->paypal_lib->add_field('currency_code', 'USD');
// Configure Return method = POST by set value 2
// Set this if you want to send any custom value
$this->paypal_lib->add_field('custom', '1234567890');
*Use this for SingleProduct/TotalPrice_IN_A_SingleRow Type Order Process by PayPal
/*$this->paypal_lib->add_field('item_name', $paypal_prod_array[0]);
$this->paypal_lib->add_field('item_number', $paypal_id_array[0]);
$this->paypal_lib->add_field('amount', $setpaypal_totlprice);
$this->paypal_lib->add_field('add', '1');*/
*Use for PaypalCartType/MultiProducts Order Process
for($loop=0; $looppaypal_lib->add_field($item_name_set, $paypal_prod_array[$loop]) {
$this->paypal_lib->add_field($item_number_set, $paypal_id_array[$loop]);
$this->paypal_lib->add_field($item_amount_set, $paypal_price_array[$loop]);
$this->paypal_lib->add_field($item_quent_set, $paypal_qunt_array[$loop]);
$this->paypal_lib->add_field($item_ship_set, '1');
//Generate Paypal Submition Form With Hidden Field
//Based on Form Field Configuration on The Above
$header_data['paypal_form'] = $this->paypal_lib->paypal_form();
$header_data['paypal_prodid_array'] = $paypal_id_array;
$header_data['paypal_name_array'] = $paypal_prod_array;
$header_data['paypal_qunt_array'] = $paypal_qunt_array;
//header('Location: '.config_item('base_url').'index.php/index/admindashboard/homeflag');
* Available CART POST DATA to Header and Session
$country_list = $this->user_model->get_country_list();
$header_data['country_list'] = $country_list;
$header_data['setpaypal_prodid'] = $flash_sess['setpaypal_prodid'] = $setpaypal_prodid;
$header_data['setpaypal_prodname'] = $flash_sess['setpaypal_prodname'] = $setpaypal_prodname;
$header_data['setpaypal_totlprice'] = $flash_sess['setpaypal_totlprice'] = $setpaypal_totlprice;
$header_data['setpaypal_totlqunt'] = $flash_sess['setpaypal_totlqunt'] = $setpaypal_totlqunt;
$header_data['setpaypal_itemprice'] = $flash_sess['setpaypal_itemprice'] = $setpaypal_itemprice;
$header_data['setpaypal_summid'] = $flash_sess['setpaypal_summid'] = $setpaypal_summid;
if($paypal_flag=="OFF") {
if($paypal_flag=="ON") {

Do not follow the same on the above code. Your controller just like your requirements. My code just help you to guess what to do.