Compress image size without lose quality using php

Compress image size without lose quality function compress($source, $destination, $quality) { $info = getimagesize($source); if ($info[‘mime’] == ‘image/jpeg’){ $image = imagecreatefromjpeg($source); }elseif($info[‘mime’] == ‘image/gif’){ $image = imagecreatefromgif($source); }elseif($info[‘mime’] == ‘image/png’){ $image = imagecreatefrompng($source); imagejpeg($image, $destination, $quality); return $destination;} } $source_image = ‘original_folder/original_image.jpg’; $compress_image = ‘compress_folder/compress_image.jpg’; $compressimage = $this->compress($source_image, $compress_image, 90); First parameter for original image…

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(*)…

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,…

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″?> <configuration> <system.webServer> <rewrite> <rules> <rule name=”codeigniter” patternSyntax=”Wildcard”> <match url=”*”/> <conditions> <add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true”/> <add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true”/> </conditions>…

Convert stdClass object to array in pHp

Object to array convert in php For e.g Array ( [0] => stdClass Object ( [user_id] => 10 ) [1] => stdClass Object ( [user_id] => 20 ) ) Convert into array Array ( [0] => 10 [1] => 20 ) $array = json_decode(json_encode($object),true);

Upload large mysql database using php

<?php ini_set(‘memory_limit’, ‘999M’); //ENTER THE RELEVANT INFO BELOW $mysqlDatabaseName = ‘dbname’; $mysqlUserName = ‘db_user’; $mysqlPassword = ‘db_password’; $mysqlHostName = ‘localhost’; $mysqlImportFilename = ‘db_file.sql’; //DO NOT EDIT BELOW THIS LINE //Export the database and output the status to the page $command = ‘mysql -h’ . $mysqlHostName . ‘ -u’ . $mysqlUserName . ‘ -p’ . $mysqlPassword…

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. Features: Listing of donation entries at admin area. Payment gateway settings at admin area which allows to…