Contact form 7 success or failure message show in popup


, , , , , ,

Add your popup code between if and else if condition

$(“.wpcf7-submit).click(function(event) {
$( document ).ajaxComplete(function() {
var result =$(“.wpcf7-response-output”).hasClass(“wpcf7-validation-errors”) ? “fail” : “success”;
if(result==’fail’){ // error popup code }else if(result==’success’){ // success popup code }

Command line stuff


, , , , , , , , , ,

Welcome to command/Terminal line stuff

How to give permission for particular folder and files?

Chmod 777 to a folder and all contents
=> Go to your folder/files which you want to give permission
=> After type following command: sudo chmod -R 777 /www/abc

How to zip using command line

All files & folder using star(*)
– sudo zip -r  * OR Specific folder –


For Specific folder
– sudo zip -r   folder_name

How to Transfer zip to direct another server

Go to project folder where you want to transfer zip and then type below command.
type: sudo wget

How to Unzip using command line

type: sudo unzip

Repositories commit with different name

1) git add -A

2) GIT_COMMITTER_NAME=”krish chauhan” GIT_AUTHOR_NAME=”krish chauhan”
GIT_COMMITTER_EMAIL=”” GIT_AUTHOR_EMAIL=”” git commit -a -m “commit 2”

simple commit
– commit -m ‘demo file change’

push file
3) git push


How to Enable leverage browser caching on AWS

Type below commands:
sudo a2enmod headers
sudo a2enmod expires
sudo service apache2 restart

How to sort array on given key in php?


, , , , , , ,

Sometime we require array in specific order that time we need to sort array in specific order in ascending or descending order as par requirement view.
Using php array key we can sort array in ascending or descending order
Here first argument is pass array data, second is the array key and third one is optional, default showing in ascending order array

function sortbyKeyValue($data, $sortKey, $sort_flags=SORT_ASC)
if (empty($data) or empty($sortKey)) return $data;$ordered = array();
foreach ($data as $key => $value)
$ordered[$value[$sortKey]] = $value;

ksort($ordered, $sort_flags);
return array_values($ordered);

Remove index.php file in codeigniter OR wordpress on windows server


, , , , , , ,

Remove index.php file in Codeigniter or wordpress or other freamwork  on Windows IIS7 Server

Sometime .htaccess file does not work on windows server, so we have use web.config file insted of .htaccess in root path


<?xml version=”1.0″ encoding=”UTF-8″?>
<rule name=”codeigniter” patternSyntax=”Wildcard”>
<match url=”*”/>
<add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true”/>
<add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true”/>
<action type=”Rewrite” url=”index.php”/>

Upload large mysql database using php


, , , , , , , ,

ini_set(‘memory_limit’, ‘999M’);
$mysqlDatabaseName = ‘dbname’;
$mysqlUserName = ‘db_user’;
$mysqlPassword = ‘db_password’;
$mysqlHostName = ‘localhost’;
$mysqlImportFilename = ‘db_file.sql’;

//Export the database and output the status to the page
$command = ‘mysql -h’ . $mysqlHostName . ‘ -u’ . $mysqlUserName . ‘ -p’ . $mysqlPassword . ‘ ‘ . $mysqlDatabaseName . ‘ < ‘ . $mysqlImportFilename;
exec($command, $output = array(), $worked);
switch ($worked) {
case 0:
echo ‘Import file ‘ . $mysqlImportFilename . ‘ successfully imported to database ‘ . $mysqlDatabaseName . ‘‘;
case 1:
echo ‘There was an error during import. Please make sure the import file is saved in the same folder as this script and check your values:’;

WP-Donate a WordPress donation plugin

WP-Donate is a wordpress plugin by webconfines which provides donation form with AuthorizeNet payment gateway option and most importantly it provides management of donation entries at admin area which allows website owners to keep track on received donations.


  1. Listing of donation entries at admin area.
  2. Payment gateway settings at admin area which allows to set related details.
  3. From displayed at client side using Shortcode.
  4. payment gateway integration for accepting donation.


WP Donate can be used by either calling up a simple shortcode or adding the function to your template as below:

  1. Upload the folder wp-donate to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Go to WP Donate (for both Test & Live)
  4. Place [Display Donate] in your content or <?php wp_donate_form(); ?> in your template.