Find object by value in array of objects

In PHP we either create objects and their array, or database returns array of objects as result-set of some query. There we might need to find an object which have a particular property-value pair. There is no direct function available in PHP to perform the same so I’m explaining here how can we find object by value in array of objects by using a foreach loop.

Read More

Fancybox ajax content & navigation issue in group & popup

While working with fancybox, you might have noticed that any button or link or input inside fancybox popup just behaves like previous/next item slider, making that coming item to appear in popup rather of doing it’s assigned code on click. All the reason is the width specified for `fancybox-nav` class with higher `z-index` for it.

Read More

MySQL insert row if not exists else update record

Sometimes we create MySQL tables which don’t contain auto increment primary key column instead they may have unique key or combination of unique indexes. In such tables we wish to insert a new row if primary/unique key or keys combination doesn’t exists and update record if exists.

Read More

Get query string parameters values from URL in JavaScript

Sometimes we need to retrieve URL parameters values from browser address bar in our client side script to process some functioning like click to a button or show/hide some elements. Here I have created a function in JavaScript to get query string parameters from URL and displayed uses example.

Read More

escaping special characters in jQuery selector

jQuery is a very powerful javascript library that We use all the time. It’s simple to use, yet easy enough to do very advanced things. Anyone who has used jQuery knows that you can do quite a lot with selectors. One of the caveats that I found is using a selector for a DOM element that contains special characters.

Read More

No input file specified. Codeigniter & htaccess

I have few sites of clients running with Codeigniter and are hosted by different hosts including Godaddy, Host Gator and others. With few hosts I had problems with working of CI, whenever I tried to access the website, I just used to get a text in browser saying ‘No input file specified’ and no html as expected except this text.

Read More

Htaccess redirect www to non www. http & https

This article will provide you htaccess rules to redirect a www website to non www. I prefer to make rule regardless of using name of specific domain so no-where in this article I have used domain name. The general sort of solution to make www to non www apache htaccess redirect

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]

RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

Read More

difference between a session and a cookie in ASP.NET

Both cookies and sessions are available in any type of programming language like ASP.NET, and both accomplish much the same task of storing data across pages on your site. However, there are differences between the two that will make each favourable in their own circumstance.

Read More

[ Page 5 of 27 ]