Helpful Tips and Tricks
Get Visitors Real IP Address in PHP
If you want track visitor's or user's IP address than you may use $_SERVER['REMOTE_ADDR']. Well, you might be shocked to know that it may not return the real IP address of the visitor/user at all time. Here are the cases when it happens. If visitor/user is connected to the Internet through Proxy Server then $_SERVER['REMOTE_ADDR'] in PHP will give the IP address of the proxy server and it will not be visitor's/user's IP address.
Java supports Multiple Inheritance through Interface
May be you are worried why Java doesn’t support multiple inheritance ? The reasons for omitting multiple inheritance from the Java language mostly step from the "simple, object oriented, and familiar" goal. As a simple language, Java's creators wanted a language that most developers could grasp without extensive training. To that end, they worked to make the language as similar to C++ as possible (familiar) without carrying over C++'s unnecessary complexity (simple).
.htaccess is invisible – How to make it visible in FTP Program like CuteFTP , Filezilla
As all we know that .htaccess is very popular for redirecting URLS and making SEO Friendly URLS. Using htaccess , your url looks like static url and most search engines can read your url very easily. Dynamic url with query string is difficult to read for search engines as there will be a query string in url.
301 Redirect old dynamic URLs to new static URLs using .htaccess
Today i faced a situation where i need to redirect dynamic URL of my shopping cart to static url. I have changed the Dynamic URL(with query string , ? and &) to static one in my sunshop shopping cart. But still if i will open dynamic url with query string than it shows the content. This is a big issue with search engine as they will consider this dynamic page and static page as two different page and duplicate content issue araise.
Some of Unknown and rarely used but very helpful functions of PHP
Today i have searched google and php manual to find out some of useful inbuilt functions which are not general use but having some great functionality. I found some of the function which developers rarely use but these are the very useful functions. You must spend some time to read this functions and i am sure that this functions help you while developing an application.
Allow duplicate screen_name in register page in Expression Engine
I have started working with Expression Engine since last one year. Today i came across a problem in register page of frontend where my client wants to allow duplicate screen_name while any user register using register form(User module of Expression Engine). This is because user can login with username so there is no need for unique screen_name. Also when we use the register form of Expression Engine, we have to use screen_name and username(required fields). If you use username as unique entry than you can allow users to choose screen_name as per their choices.
How to restrict users from accessing files & directory level(Protect directory) using .htaccess
Today i faced a situation where i have to restrict or deny users from accessing files and folders of my web application directly by entering URL in browser which contain very important contents like images,pdfs,docs,etc. For this what i need to do is to protect the files and folders(directory) which contains images,pdfs and docs. We can restrict users from accessing files,folders and subfolders by using .htaccess(Hyper Text Files).
Use of jQuery with other Javascript Libraries like Prototype, MooTools, or YUI..
Today i faced i problem where i want to use jquery with other javascript library (Prototype). By default jquery is using "$" as a short key for jQuery. When you use jQuery with other javascript library,jQuery object and prototype object were using same variable($). As a result they conflict with eachother and one of the functionality of javascript library will be missed. If you want to use jquery with other javascript library(Prototype, MooTools, or YUI) at the same time than you have to use different object instead of "$".
For vs Foreach – Difference between For and Foreach
You must familiar with all loops if you are a programmer/developer. There are so many loops available and you can select appropriate one when you develop an application. I found For and Foreach loops almost same. I googled for finding the difference between For and Foreach(For Vs Foreach) but didn't get any clear idea. Here i am sharing my knowledge about some of difference between For and Foreach loop.
How to sort multidimensional array in Entry Categories plugin of expression engine
Today i face a situation where i need to sort my two dimensional array by column name(table_order).I am working in expression engine , installed one of expression engine plugin(Plugin name: Entry Categories). In this plugin, it is not giving any option if you want to get categories order by particular column name. Below is the way how to get the ordered data by particular table field name(below is the code for order by cat_order).


I am
Recent Comments