How to Get Query String Parameters from URL using JavaScript

Generally, server-side language is used to get query string from URL. But you can also get query string parameters from URL to client-side. The query string parameters and values can be easily retrieved from the URL using JavaScript.

How to Check Given Date is Greater than Today using JavaScript

Date validation is very useful when you want to restrict the user to provide a future date. You can easily compare the date with current date using JavaScript. This tutorial will show you how to check if selected date is greater than today using JavaScript.

How to Validate Email in PHP

Email validation is a required action before submitting the user input in the server-side. The filter_var() function in PHP, provides an easy way for email validation. Use FILTER_VALIDATE_EMAIL filter to validate an e-mail address in PHP.

How to Get Current URL in PHP

$_SERVER is a superglobal variable in PHP, that provides information about headers, paths, and script locations. Use $_SERVER to get current page URL in PHP. If you want to get current page URL with query string, use QUERY_STRING in $_SERVER.

How to Validate First and Last Name using Regular Expression in PHP

The Regular Expression (REGEX) is the easiest way to validate full name format in PHP. You can easily validate first and last name using regular expression in PHP. Use PHP preg_match() function to perform a regular expression match.

How to Get URI Segment in PHP

The URL segments are used for many purposes in the web application. You can parse URL segment easily using parse_url() function in PHP. Use parse_url() and array_pop() function to get URI segments and last URL segment using PHP.

How to Get File Extension in PHP

The file extension is very useful for validation and upload. You can easily get extension from the file name or file location using PHP. The pathinfo() function provides the easiest way to get file information in PHP. Also, you can use substr() and strrchr() function to get file extension in PHP.

How to Disable Right Click in embed Tag using JavaScript

You can easily disable mouse right click in the web page, but it will not work in the and IFrame. The main purpose of disabling right click is to prevent the user from saving the PDF or document content. If you want to disable right click in embed tag, JavaScript onmousedown event help to do that easily.

How to Get IP Address of User in PHP

PHP $_SERVER variable provides an easy way to get user IP address. The simplest way to get the visitor IP address is using the REMOTE_ADDR in PHP. Use $_SERVER[‘REMOTE_ADDR’] to get IP address of the user in PHP. Alternatively, use HTTP_X_FORWARDED_FOR to get real IP address of user in PHP.