Category Archives: PHP

Handling Post operation in php with Disabled Radio button

Below example of code shows how to handle the value of disabled radio button passing through post method. if we use radio button group as disabled then if we click submit button it will post null value. Instead of getting null value in this example, we used a hiddenfield called “radiobutton_visibility”. When change the radio… Read More »

Find out the imagemagic path using php

Find out the imagemagic path using php If imagemagic not working in a particular server,most of the time this is because of path problem. Normaly this lbrary available in the path usr/bin. if you need to get the full path of imagemagic use the following commands in php

Click on Submit/Save button multiple times,Data is saving more than one

In an ajax based save functionality.if i click multiple times on the save button.same data is saved in db more than one depends on the number of clicks How to handle this issue in jquery solution: 1)hide the submit/save button or disable the button after click. 2)use the encodeURIComponent() function for the data passing in… Read More »

Use of window.location.hash In javascript

In a webpage contains so many links.if we click from a link it will redirect to some other page, if we came back to the previous page using back button it will point to the link where we have made click. below code will explains window.location.hash Index.php


Check box select/dselect all Examples and demo using jquery/javascript

Create a file called index.html using the below code and try to execute.code explains how select/dselect all for the list of checkbox id,class are used for the working of select all.

The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.

I can see the above error as redcolor in the firebug window while loading the page.solution is as below pleas add the below code

Category: PHP

Reset an array having Particular or similar key.Unset an array using pregmatach key search

Remove duplicate element in an array

if array elements contain multiple values like below,how to remove duplicate element

we can use array_unique on an array created using explode function.Code will be looks like below

Space validation for username

validating space in a string or checking whether space is there or not in the string using below regex function

Check box selection in Modal pop up

Below code will help you in the followin scenarios #In a model popup bydefault 10 checkbox are that two are selected. #if you select all checkbox and close the popup #again open the popup this time pop up with all checkbox selected instead of selecting 2 checkbox while clicking on the close and show… Read More »