Category : PHP


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 | | 529 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 | | 4830 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 | | 1937 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 | | 563 Viewer | Category : PHP
READ MORE

Paypal payment gateway integration in php source code example

In this post i am going to give you example of how to integrate payment Paypal gateway in php with demo. It is very simple to use paypal payment method in your native php website because you don't need to use any api for paypal payment gateway integration. Paypal provide very simple way to do this and paypal also provide developer console i mean Sandbox account that way you can check it better. In this example i give you step by step payment integration of paypal. <strong>Preview:</strong> <img src="/upload/PHP-Paypal.png" width="100%" style="border:1px solid red"> <strong>Step 1: Create Sen.....

By Hardik Savani | May 31, 2016 | | 15887 Viewer | Category : PHP
READ MORE

How to get filename without extension in PHP?

If you need to get just filename from url withour file extension then you can get that using basename() php function. In bellow example i give you how to get image name without extension. first we need to get extension of given filename url and then basename() through we can remove that extension like as i did bellow: <strong>Example:</strong> <pre class="prettyprint lang-php"> $imagePath = "/home/hd/html/test.jpg"; $ext = pathinfo($imagePath, PATHINFO_EXTENSION); <br/> $file = basename($imagePath,".".$ext); print_r($file); </pre>

By Hardik Savani | May 26, 2016 | | 744 Viewer | Category : PHP
READ MORE

How to remove white space from string in PHP?

Sometimes we require to remove white space from given string. So at that time you can delete spaces from string using str_replace() of core php. str_replace() will help to replace whitespace that way we can remove. you can do it from bellow example. <strong>Example:</strong> <pre class="prettyprint lang-php"> $myString = "this is only for you"; $resultString = str_replace(' ', '', $myString); print_r($resultString); </pre>

By Hardik Savani | May 20, 2016 | | 962 Viewer | Category : PHP
READ MORE

PHP - File upload progress bar with percentage using form jquery example

Sometimes we require to show progress bar with percentage on file upload, because sometimes if we upload large size of file then we should too much wait without known perfect time. So at that time if we add progress bar with percentage then it is more comfort then other, that way user can see how much time it will take and how much upload. In this example i going to give you File upload progress bar with percentage using form jquery example in php. in this example i use form js that way we can upload using ajax and we don't need to page refresh. in this example you have to create only two fi.....

By Hardik Savani | May 19, 2016 | | 9460 Viewer | Category : PHP
READ MORE

How to get ip address using php code?

Whenever you require to get current user ip address then bellow example will help you. you can find client ip address using $_SERVER variable in php. As you can see bellow example how to find use ip address. <strong>Example:</strong> <pre class="prettyprint lang-php"> <?php <br> function getClientIp() { $ipAddress = ''; if (isset($_SERVER['HTTP_CLIENT_IP'])){ $ipAddress = $_SERVER['HTTP_CLIENT_IP']; } else if(isset($_SERVER['REMOTE_ADDR'])){ $ipAddress = $_SERVER['REMOTE_ADDR']; }else{ $ipAddress = 'UnKnown'; }.....

By Hardik Savani | May 17, 2016 | | 909 Viewer | Category : PHP
READ MORE

Dynamic Autocomplete search using Bootstrap Typeahead JS Example

In this post i am going to show you how to add dynamically Autocomplete using typeahead dynamic. In this post i give you full example that way you can run this example easily in your project. after run this example you can see output like bellow preview. <img width="100%" style="border:2px solid red" src="/upload/Bootstrap-Typeahead-with-Ajax-Example.png"> First we will create ajax.html file for html layout in this file i added jquery and Bootstrap Typeahead code. When you write on input box then you can find Dynamic Autocomplete search using ajax requiest. So, first create aja.html file an.....

By Hardik Savani | May 13, 2016 | | 50393 Viewer | Category : PHP
READ MORE

    Laravel 5 - Implement Flash Messages with example

    Laravel 5 - Implement Flash Messages with example

    Open Post

    Codeigniter 3 - Generate PDF from view using dompdf library with example

    Codeigniter 3 - Generate PDF from view using dompdf library with example

    Open Post

    Bootstrap progress bar animate example using bootstrap-progressbar.js

    Bootstrap progress bar animate example using bootstrap-progressbar.js

    Open Post

    Laravel 5 custom pagination view example

    Laravel 5 custom pagination view example

    Open Post

    Laravel 5 - Example of Database Seeder with insert sample data

    Laravel 5 - Example of Database Seeder with insert sample data

    Open Post

    How to implement Email Verification with Activation Code example from Scratch in Laravel 5.2 ?

    How to implement Email Verification with Activation Code example from Scratch in Laravel 5.2 ?

    Open Post