Category : PHP


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 | | 3485 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 | | 504 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 | | 499 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 | | 3857 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 | | 653 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 | | 8543 Viewer | Category : PHP
READ MORE

How to check word exist in string or not in PHP?

I want to share this posts because when i was working in my laravel application i need to find word from string, I mean check string contains word or not but i try to do, at last i found two way we can check easily. First one using preg_match and other one strpos() of php predefine. if you have question how to php regular expression match word then you can do this way: <strong>Example 1:</strong> <pre class="prettyprint lang-php"> $str = "Hi, I am from itsolutionstuff.com"; if (strpos($str, "from") !== false) { print_r("Yes, exists"); } </pre> <strong>Example 2:</strong> <pre class="prett.....

By Hardik Savani | May 3, 2016 | | 384 Viewer | Category : PHP
READ MORE

How to get current page url in PHP?

Whenever you need to get actual page url in Native PHP then you can do using this post. I give you the example that way you can get easily current URL in PHP. following PHP code through you can get: <strong>Example:</strong> <pre class="prettyprint lang-php"> $currentLink = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; print_r($currentLink); </pre>

By Hardik Savani | May 2, 2016 | | 580 Viewer | Category : PHP
READ MORE

How to get file size in php ?

If you require to get file size in php then you can do it easily using filesize() of PHP. Normally we require to get and check on before image uploading. So if you want to get image size then bellow example can help you. It will return size on byte. <strong>Example:</strong> <pre class="prettyprint lang-php"> echo filesize('flower10.jpg') . ' bytes'; </pre>

By Hardik Savani | April 29, 2016 | | 494 Viewer | Category : PHP
READ MORE

JQuery - Delete confirm modal using bootbox example

We always need ask confirmation for remove items. I mean we always ask before deleting items. So if you need to ask confirm before do something like delete, change status, change value etc as you require. If you want to do with better layout then you have to chooes bootbox.js and if you already use bootstrap then it's very better so, let's see bellow example and use it. <strong>Example:</strong> <pre class="prettyprint lang-html"> <html lang="en"> <head> <title>Delete confirm modal using bootbox example</title> <link href="https://maxcdn.bootstrapcdn.com/bo.....

By Hardik Savani | April 28, 2016 | | 2725 Viewer | Category : PHP
READ MORE

    Laravel 5 Facebook authentication using Socialite Package

    Laravel 5 Facebook authentication using Socialite Package

    Open Post

    How to add multiple markers in google map

    How to add multiple markers in google map

    Open Post

    How to implement lazy loading image with example for your website?

    How to implement lazy loading image with example for your website?

    Open Post

    Laravel 5.3 - import export csv and excel file into database

    Laravel 5.3 - import export csv and excel file into database

    Open Post

    Solved - Access Not Configured. Google+ API (truncated...) on google console developer

    Solved - Access Not Configured. Google+ API (truncated...) on google console developer

    Open Post

    PHP - import excel file into mysql database tutorial

    PHP - import excel file into mysql database tutorial

    Open Post