Category: PHP

How we can create custom post type plugin.

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
How we can create custom post type plugin: In this post you will learn how to create a custom post type plugin in WordPress.   What is Custom Post Type Plugin? If you want create own custom posts in your site, you will use custom post type plugi [...]

How to save image as featured image in WordPress

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
If you want to save the image as featured image from front end form. Here is the code for making the image as featured image for a particular post. $filename = $_FILES[‘attachmentfile’][‘name’]; $wp_filetype = wp_check_filetyp [...]

PHP7 Introduction

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
You might have knowledge about active development of the biggest version of PHP7. It takes near about a year for the development. Finally the wait is over and we have brand new version of PHP7 with us. The PHP7 timeline was scheduled by members of co [...]

PHP code to subscribe user directly to mailchimp using CURL

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
MailChimp is the most famous online email marketing software and is offered free of cost. It allows the user to subscribe and send newsletter in bulk to them. It also manages your subscriber’s lists. MailChimp makes it easy to integrate email s [...]

How to generate an API key from mailchimp account?

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
You would have to follow the following steps Login to your mailchimp account. After Login, on the top right corner before Help, you will see your account name with down arrow. Click on that. You will see an option of “Account” there. Clic [...]

What is REST API?

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
REST API REST stands for ‘Representational State Transfer’. It’s an architectural style and an approach to communication for the developement of web services. Roy Fielding in 2000 first introduced REST. REST basically uses HTTP pro [...]

How to use Ajax using jQuery in PHP?

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
How to use Ajax using jQuery in PHP? Firstly, you have to include the <script src=”https://code.jquery.com/jquery-1.12.0.min.js”></script> before </head> Or use the latest jQuery version as required. Then, use the main c [...]

How to get the list of file names in a folder in PHP?

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
In PHP5, PHP7 it is easier to find the name of files. We are having the function using which we can find the names of the files under a specific folder. You can use the:   <?php $dir = ‘C:/xampp/htdocs/phpSupport/questions/doctopdf/R [...]

How to integrate Paypal Payment Gate way?

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
For simple PayPal integration we just have to send the user to the PayPal site with the required information to process the order. Here is the code to use that it in a simple manner. First of all you have to create a form and pass the value into the [...]

How to produce forget password recovery method with PHP?

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
Here we need to create two pages connect.php forgotpassword.php file 1:-connect.php <?php $connection = mysql_connect(‘localhost’, ‘root’, ”); if (!$connection){ die(“Database Connection Failed” . mysql_er [...]

Easy way to make login page in PHP

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
Most easy way to make login page in PHP:- <?php define(‘DB_HOST’,’localhost’); define(‘DB_NAME’,’logina’); define(‘DB_USER’,’root’); define(‘DB_PASSWORD’,”); [...]

Send attachment in PHP mail function

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
In this post you will learn how to send doc attachment, pdf attachment any file attached in your php email. You can send a file through php mail function using HTML form in PHP. Firstly you have to create simple HTML form. HTML Code <form action=& [...]

How to upload zip file in php?

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
In this post you will learn how to upload zip file into a folder using HTML form in PHP. Firstly you have to create simple HTML form. HTML Code <form action=“upload.php” enctype=“multipart/form-data” method=”post̶ [...]

How can we check current date & time of PHP server?

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
We can check the PHP server time by using the following code date(“Y-m-d H:i:s”); [...]

Tips to remove file from server – PHP

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
In this post you will learn some basics to remove file from server. Please check the code given below. This will help. You just need to use the following function Unlink(FILENAME); Here FILENAME will be the path of file with name. [...]

What is the use of explode in PHP?

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
In this post you will learn about the use of explode in PHP. Please check the code given below. This will help.   PHP Code Explode breaks the string into pieces(array) $str = “2008/12/10”; // This is a string. I will break it from &# [...]

How can we start the session in core php?

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
In this post you will learn how to start the session in core php. Please check the code given below. This will help. PHP Code To start a session, you need to add the following code at the top of the filesession_start(); $_SESSION[‘USERNAME̵ [...]

What is the difference between include and require in PHP?

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
What is the difference between include and require in PHP? Require – If the file is not found, then it will return fatal error and will put a halt on execution. Include – If the file is not found, then it will return Warning only. It will [...]

To create connection with MySQLi in PHP

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
In this post you will learn how to create connection with MySQLi in PHP. Please check the code given below. This will help. PHP Code $host = “localhost”; // Enter your host name $sqlusername = “username”; // MySQL username $sq [...]

Comparison Of Two Dates For Conditions – PHP

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
In this post you will learn how to compare two dates in PHP. The best method of this is to change the dates to strtotime. Please check the code given below. This will help. Date Format is YYYY-MM-DD PHP Code $end_date = “2016-10-12”; $sta [...]