Showing posts from 2013

Get current controller or action name in Yii

Many time you need to get current controller or action name from Url during coding in yii. Lets Take an example : Suppose your current url in yii like below : http://www.xyz.com/controllerName/ActionName/ http://dev.trademyway.com/trade/MyView…

Select Query In Yii Framework

Select Record from database in yii     There are two way to write select query using create command in Yii framework :           Firstway :         $user = Yii::app()->db->createCommand('SELECT id, username, profile FROM tbl_user u joi…

How to Delete first or last index and value of an array using PHP

If you want to delete first or last element of array .Then you can use two very useful php functions 1- array_shift() --- It delete the first index and value of an array. 2- array_pop() --- It delete the last index and value of an array. Example…

How to get only not null array index and value in php

I want to count the total number of element of an array.But my problem is that when i am counting the element of array using count() or sizeof() function then its also count that index which value is empty . My array is below :-- Array ( [sea…

Auto compleate property of form, textbox and textarea

Every time when you creating and submitting a form then you will see that form fields are filled every time after submit form.Actually it takes data from brouser catche memory.Some time you don't need that data for security reason or may be any o…

Resize your Image using simpleImage class in php

If you have problem to resize your  image in php then using this simple class file and resize your image very simple. What you need to do: (a)-You just need to copy the entire code below and  paste it into a file name Simpleimage.php . class Si…

Change Case Of Table Column Using Sql

In some situation you want to change case (Upper case to Lower case or Vice-Versa) of any table column data of your database using sql then LOWER() or  LCASE()  and UCASE() or  UPPER() is very useful sql keyword to fulfill your need.  HOW TO USE :…

Create Ramdom Password For Your User In Php

Some time when you need to generate ramdom password or something like random string.Then my this code is really helpful for you. function createRandomPassword() {         $chars = "abcdefghijkmnopqrstuvwxyz023456789";         srand((doubl…

Implement Image Slider With Zero Percent Effort.

Below is the entire code of my image slider.You just need to be copy the entire code and paste it into the php or html file.If you have internet connection on you computer then you don't need to be make any changes on it.All image and js are come…

Steps for Installation and Configure a WAMP Server on your computer

There are times when we are so anxious to jump into creating something new that we forget to cover the basics. For web developers it is important, actually vital, to have the ability to test your projects locally before they go live. While much o…

What is php and history of php language

PHP development began in 1994 when the developer Rasmus Lerdorf wrote a series of Common Gateway Interface (CGI) Perl scripts, which he used to maintain his personal homepage. The tools performed tasks such as displaying his résumé and recording his…

Multiple error display every times using jquery validation

Multiple   error is display every times when i click on submit button. See Below Example: Solution : In my case i put my form tag between table .Thats why every time when i click on submit button it display error multiple times. My Htm…

Making Auto Fill Text Box In php

Some time you need to make an option of auto fill when user start typing in text box then relavent result could display below of text box in drop-down in php like below Example : <input type="text" name="producttmfg…

Disable resize property of text area

When you add textarea input in your html then by default its resize property is enable and its display a resize icon on bottom right side by default See below: Before adding style : If you want to remove it then  then you have to be add a st…

Change image after given time duration

In some situation you have to be required to change image after given time duration . Suppose a situation you want to display an ad image on a prticular location and you want that after some time it will replace with the next ad image .  Check th…

RoutingTechniques in code-igneter

If you are using code-igneter then it have a very nice feature to rewrite your website url using route.php and you can make your site seo friendly very easily. (1)-Suppose if you want to redirect all link which is start with name page after your ba…

Create direction on google map (By draw straight line straight line)

If you want to display direction on google map to draw a straight line in php code.Then you need to just copy and paste below code .Before copy this you need to be include google map library and make it constructor like below : $google_maps = new G…

Filter or Remove special charecters or space from string in php

Hello guys if you want to remove all special chareters like (&  # @ % , ' ! )  etc every thing then this post is really helpful for you . Watch below example  : My string is like this "Lakeside Landing , RV Resort & Marina"…

Password protect site using htaccess

There is a situation where you want to be protect your site using htaccess that no body can access your site except you  . Step you need to be follow : Create the Password File Open a new text file called .htpasswd Note the period at the beg…

Load More
That is All