How to send an email using PHPMailer ?
PHPMailer is a code library and used to send emails safely and easily via PHP code from a web server. Sending emails directly via PHP code requires a high-level familiarity to SMTP standard protocol and related issues and vulnerabilities about Email injection for spamming. PHPMailer simplifies the process of sending emails and it is very easy to use. Installation: The best way to install PHPMailer is by using composer. Before proceeding make sure to install composer....
read more
PHP | urlencode() Function
The urlencode() function is an inbuilt function in PHP which is used to encode the url. This function returns a string which consist all non-alphanumeric characters except -_. and replace by the percent (%) sign followed by two hex digits and spaces encoded as plus (+) signs....
read more
How to make a redirect in PHP?
Redirection from one page to another in PHP is commonly achieved using the following two ways:Using Header Function in PHP: The header() function is an inbuilt function in PHP which is used to send the raw HTTP (Hyper Text Transfer Protocol) header to the client. Syntax:...
read more
Why to check both isset() and !empty() function in PHP ?
isset() Function...
read more
How to calculate the difference between two dates in PHP ?
In this article, we will see how to calculate the difference between 2 dates in PHP, along with understanding its implementation through the examples. Given two dates ie., start_date and end_date & we need to find the difference between the two dates....
read more
PHP | mysqli_num_rows() Function
The mysqli_num_rows() function is an inbuilt function in PHP which is used to return the number of rows present in the result set. It is generally used to check if data is present in the database or not. To use this function, it is mandatory to first set up the connection with the MySQL database....
read more
Difference between HTTP GET and POST Methods
HTTP (Hypertext Transfer Protocol) specifies a collection of request methods to specify what action is to be performed on a particular resource. The most commonly used HTTP request methods are GET, POST, PUT, PATCH, and DELETE. This article covers the 2 most common HTTP request methods, i.e. the GET & POST Methods among the rest of the methods....
read more
How to Create a Facebook Phishing Page ?
...
read more
Get the full URL in PHP
In this article, we will see how to get the complete URL of currently running pages using PHP, along with understanding their implementation through the examples. $_SERVER is a super global variable in PHP that contains the details related to the header, paths, and script locations. The status of HTTPS will be saved in the Global variable $_SERVER[‘HTTPS’]. So, using the $_SERVER[‘HTTPS’] in isset() function, that is used to check whether it exists or not. This will also tell us whether HTTPS is enabled or not. Check the value of $_SERVER[‘HTTPS’], if it is “on”, then HTTPS is enabled and we have to append “https” to the URL....
read more
Create a drop-down list that options fetched from a MySQL database in PHP
In many scenarios, we may need to create a dropdown input that can display all the options consistent with the current state of the database. This form of input is used many times in real life and the following examples may help to understand the same....
read more
How to open a PDF files in web browser using PHP?
PHP uses a standard code to display the pdf file in web browser. The process of displaying pdf involves location of the PDF file on the server and it uses various types of headers to define content composition in form of type, Disposition, Transfer-Encoding etc. PHP passes the PDF files to read it on the browser. Browser either shows it or download it from localhost server then display pdf....
read more
PHP | strtotime() Function
The strtotime() function is a built-in function in PHP which is used to convert an English textual date-time description to a UNIX timestamp. The function accepts a string parameter in English which represents the description of date-time. For e.g., “now” refers to the current date in English date-time description. The function returns the time in seconds since the Unix Epoch. We can return the English textual date-time in date format using the date() function....
read more