Category : PHP


PHP - jquery ajax crop image before upload using croppie plugin

we mostly need to crop image before upload and as specially when we save image for user profile or etc. In this post i tell you how to crop image and save using jquery ajax. In this example i use croppie plugin that provide to crop image with zoom and etc. croppie.js plugin is very professional that way we can easily use for crop profile image. Bellow example through you can implement easily with php and jquery. It is pretty simple example for upload crop and save image php using croppie.js plugin. You have to create two file and one upload directory for store crop image like as bellow: <s.....

By Hardik Savani | August 6, 2016 | | 5163 Viewer | Category : PHP
READ MORE

Jquery select2 ajax autocomplete example with demo in PHP

Jquery select2 plugin is a very famous jquery plugin, using select2 plugin we can do several thing like select box with search, select option with check box, ajax auto-complete etc. We normally require to do autocomplete task with select box when we have large amount of data like products, items, category, tag, user etc. so we can't load all then data at time and it's hard to find that item from several records. So select2 plugin provides us with select box with search and Ajax dynamically auto complete that way page will never load more and it will work fine. In this example, I have two fil.....

By Hardik Savani | August 5, 2016 | | 6337 Viewer | Category : PHP
READ MORE

Solved - opencart this merchant is not enabled for auth/settle

When i was learning opencart and i was trying to setup paypal integration with sand box then i fetch one error. Every thing was working proper but when i try to pay money i found error like as bellow: <pre> this merchant is not enabled for auth/settle </pre> I did also try to change my buyer account and try but same, I also did try with different way but same result. At last i found that i used <strong class="path">Personal</strong> account on opencart module setting, we require to use <strong class="path">Business</strong> Account. So when you create new user then select Business in account.....

By Hardik Savani | July 25, 2016 | | 635 Viewer | Category : PHP
READ MORE

How to get last 2 days records from table using Mysql Query?

We may sometimes require to get few days ago records from table like last 2 days, last 3 days, last 10 days or last 15 days etc. Most of developer choose other logic but we can easily get using mysql query(using CURDATE and INTERVAL). In this example mysql query i have one table "elements" and columns are id, title, description, created_at(timestamps) and update_at, Now we will get all records of last 2 days.so you can fetch fields value using CURDATE and INTERVAL of mysql. In following example you can see how to select data of last two days. <strong>Query:</strong> <pre> SELECT * FROM `elem.....

By Hardik Savani | July 22, 2016 | | 654 Viewer | Category : PHP
READ MORE

Bootstrap form validation example with demo using validator.js plugin

We always need to add validation on form like registration form, contact form, login form etc. we always prefer to give validation error after page refresh but you can give validation without page refresh. If you use bootstrap then you can use easily validator.js plugin. validator.js plugin gives client side validation without page refresh. We can use simply. validator.js plugin we can add validation in our PHP project, or any framework like laravel framework, codeigniter framework, symphony framework etc. In this example i give you how can you give validation for require field, email, minle.....

By Hardik Savani | July 20, 2016 | | 5511 Viewer | Category : PHP
READ MORE

How to remove duplicate values from Array in PHP?

It is pretty simple to delete duplicate values from PHP Array. But sometimes we confuse for how can we remove. But PHP provide pre-define function array_unique that can help to remove duplicate values from Array. array_unique() through we can get only unique value from array. So, you can see bellow example i have 34 value two times but when i use array_unique() then it will return only unique value as bellow output: <strong>Example:</strong> <pre class="prettyprint lang-php"> $myArray = [11,34,56,78,34]; $myArrayNew = array_unique($myArray); print_r($myArrayNew); </pre> <strong>Output:</str.....

By Hardik Savani | July 14, 2016 | | 421 Viewer | Category : PHP
READ MORE

How to get folder path from file path in PHP?

Sometimes, we require to get directory path from Image path or file url in our PHP website or any PHP framework website at that time we can get folder name using php pre-define function dirname. If you ever use this function then you can see as bellow example how it's works. I have one image url like, i want to just get folder path then you can get folder path like this way : <strong>Example:</strong> <pre class="prettyprint lang-php"> dirname('http://localhost:8000/upload/images/test.jpg'); </pre>

By Hardik Savani | July 4, 2016 | | 381 Viewer | Category : PHP
READ MORE

How to add CKEditor with image upload using KCFinder in PHP Example Code?

We can implement ckeditor with image uploading in PHP simply. if you want to use ckeditor in your PHP project and you also want to add file uploading as well then you can do easily to follow bellow step. In this example i use ckeditor with KCFinder for image uploading. KCFinder through we can file upload easily using their api. If you don't know about ckeditor and KCFinder then no issue you can add simple way. Now, i will give you few step to set ckeditor with file uploading and you will easily apply this. this is a very simple to browse your image, file etc upload. <strong>Preview:</stron.....

By Hardik Savani | June 30, 2016 | | 1706 Viewer | Category : PHP
READ MORE

How to solve - you dont have permission to upload files in KCFinder ?

I was working on my project and implementing KCEditor and CKFinder (the free one) with image upload, but when i tried to upload image i found error like "you don't have permissions to upload files". So, i though maybe issue for folder permission because i used ubuntu OS. i gave whole ckfinder folder give full permission 777 and also give ckeditor folder too. but same error. At last i found how to solve it. So if you have also fetch this error then you have to open config.php file in conf folder of ckfinder and disabled equal to give false. <strong>ckfinder/conf/config.php</strong> <pre clas.....

By Hardik Savani | June 30, 2016 | | 871 Viewer | Category : PHP
READ MORE

How to get filename from path in PHP?

Sometimes, we may require to get only filename or image name from full path or url in your PHP project or any framwwork project at that time you can get file name using php pre-define function basename. If you ever use this function then you can see as bellow example how it's works. I have one image url like, i want to just get image name then you can get image name like this way : <strong>Example:</strong> <pre class="prettyprint lang-php"> basename("http://itsolutionstuff.com/upload/Laravel-5-Mailgun.png"); </pre>

By Hardik Savani | June 30, 2016 | | 398 Viewer | Category : PHP
READ MORE

    Jquery email autocomplete example with demo using jquery.email-autocomplete.min.js

    Jquery email autocomplete example with demo using jquery.email-autocomplete.min.js

    Open Post

    How to get filename from file path in MySQL?

    How to get filename from file path in MySQL?

    Open Post

    iOS 7 style switches for checkboxes example using switchery JS

    iOS 7 style switches for checkboxes example using switchery JS

    Open Post

    Laravel 5 - generate PDF from html view file and download using dompdf

    Laravel 5 - generate PDF from html view file and download using dompdf

    Open Post

    How to disable model timestamps in Laravel 5.3?

    How to disable model timestamps in Laravel 5.3?

    Open Post

    Mailgun setup with Laravel 5 example

    Mailgun setup with Laravel 5 example

    Open Post