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.

By: CodexWorld Feb 7, 2018
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.

By: CodexWorld Nov 26, 2021
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.

By: CodexWorld Jan 11, 2018
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.

By: CodexWorld Apr 15, 2023
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.

By: CodexWorld Nov 27, 2017

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.

By: CodexWorld Nov 9, 2017
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.

By: CodexWorld Nov 19, 2023

The json_encode() function in PHP provides an easy way to pass an array to JavaScript. Using json_encode() function, you can pass multidimensional array to the JavaScript function and the PHP array can be accessed as a JavaScript object.

By: CodexWorld Oct 5, 2017

Sometimes needs to change the URL structure for SEO or other purposes. In that case, the old URL shows 404 error which is very confusing for the website’s visitor. To avoid this situation, you can redirect the old page (non-existing) request to new page URL by the .htaccess file.

By: CodexWorld Sep 19, 2017
keyboard_double_arrow_up