Using Ajax in Drupal6 Select Box

Using Ajax in the Drupal is so easy but can be a little work around at the beginning. In this post I will go with the technique of how we can deploy the Ajax in Drupal Form in our custom module using Jquery , Drupal Api .
Read the rest of this entry »

Drupal, Javascript, Jquery, Php

Getting Session Id in CodeIgniter

CodeIgniter does not use native PHP sessions. It uses cookies to manage the sessions by tracking IP address , User agent , Hash Session Id .

Read the rest of this entry »

CodeIgniter

Show loader image on the middle of the page on Ajax request using Jquery.

Now a days , use of Ajax in the web pages has increased subsequently to build the better user experiences. We often put the XMLHttp request (Ajax) to the server scripts to get the results from server and manipulate the results as per desired using client side scripts (javascripts) . Basically we prefer using some loader images on ajax request to notify that user request is in process. So , here I have wrote simple jquery scripts to enhance better image loader on ajax request with inbuilt UI blocker (to restrict other events during request) . If we are using huge number of ajax request then , this script can sound helpful.In this script I have used Jquery with object oriented javascript approach . I did not bother to make it as plugin , becuase its not that huge and not any setting required. :)

Read the rest of this entry »

Javascript, Jquery

Storing and displaying the image stored as varbinary in MSSQL server using PHP (CodeIgniter)

I am not used to MSSql server with php . MSSQL server has very less documentation compared to Mysql . So here I am writing a short snippets to upload image to MSSQL server in field type ‘varbinary’ and display the image to browser using php framework codeIgniter. Using framework for php application development is always a good idea.
Read the rest of this entry »

CodeIgniter, MSSQL Server, Php

Simple vertical accordion menu using JQuery

I saw various tutorial and jquery snippets to create accordion menu, but most of them were only on mousehover event but nothing with mouse out event.A hectic problem can persist when we try to render the accordion effect with mouseover and mouseout event. So we need to use jquery mouse event i.e ‘hover’ or ‘mouseenter’ and ‘mouseleave’.
Read the rest of this entry »

Jquery

Display nested categories inside Select Box , List ( UL, LI ) and BreadCrumb using single PHP Class

Creating categories and its sub categories is always prevalent when we are developing simple to huge applications. Basically we  will have the requirement of creating one- leveled subcategory of parent category but when we come across creating multi-leveled subcategories , then it  seems little vague, complex to meet the requirement. Here I have made a simple php class to create multi-leveled nested categories on select box, List and creating ‘BreadCrumb’ when navigated to those categories. Prime essence of this PHP class is use of recursive function ( calling parent function again and again ).
Read the rest of this entry »

Mysql, Php

Highlight the matched text using php

We can often see the text being highlighted if the paragraph or text  matches the supplied keyword in many forums and blogs .  We can render this effect using javascript also but here I will go with the simple method of highlighting the matched texts using php .  Using javascript for doing this I think will be little inflexible because all the text has to load before the highlight effect is rendered in the browser.
Read the rest of this entry »

Php

Get country date and time with GMT difference and display the time in client side like digital clock using php and javascript

I am writing this post in regard to the problem I faced when I had to display the county datetime  and display the time as digital clock  in clients computer. When I was new to the php programming , I was not aware of gmt time but however  I get done with problem in a stupid manner.  I would like to define how I made it worked.  First I took the server current time and mapped with my current country time to find  the difference . Then I deducted  that time difference with the server time to meet my country time and made it like digital clock using javascript. There was nothing problem with the javascript but it was with the technique I followed to get my country time. I was not aware of the problem this technique can bring in future unless I met  Roshan Bhattarai
Read the rest of this entry »

Javascript, Php

Difference between javascript function setTimeout() and setInterval()

Mostly we use javascript function ‘setTimeout()’ and ‘setInterval() ‘ to create timer for various client side animations or to execute the functions after certain interval of time. I have seen javascript programmer using these function but not aware of what exactly the difference is between these two functions. Both of these function takes two parameters , one is function that is required to be executed and other is time interval or delay after which the specified function executes. We can stop the execution of these  two functions  by ‘clearTimeout()’ and ‘clearInterval()’ for setTimeout() and setInterval() function  respectively .
Read the rest of this entry »

Javascript

Hello world application using Django framework(Python)

In my previous post I have written about the django installation in windows platform and run django development server. In this post I will go through the steps about how to create ‘hello world’  application using python web development framework i.e  django . If you have problem about django installation and creating project in django then please refer to this post .
Read the rest of this entry »

Django, Python