Home Backend Development PHP Tutorial How to implement email address verification in js and php_PHP tutorial

How to implement email address verification in js and php_PHP tutorial

Jul 13, 2016 am 10:41 AM
php and exist address accomplish method have regular Browser of end Mail verify

There are many ways to verify email addresses. On the browser side, js email verification can be detected through regular expressions.

For example:

Copy code The code is as follows:

function isEmail(email) {
return /^( (([a-z]|d|[!#$%&'*+-/=?^_`{|}~]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])+(.([a-z]|d| [!#$%&'*+-/=?^_`{|}~]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])+)*)|((x22)((((x20|x09)* (x0dx0a))?(x20|x09)+)?(([x01-x08x0bx0cx0e-x1fx7f]|x21|[x23-x5b]|[x5d-x7e]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])|(\ ([x01-x09x0bx0cx0d-x7f]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])))*(((x20|x09)*(x0dx0a))?(x20|x09)+)?(x22)))@ ((([a-z]|d|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])|(([a-z]|d|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])([a-z]|d|-|.|_ |~|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])*([a-z]|d|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF]))).)+(([a-z]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF ])|(([a-z]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])([a-z]|d|-|.|_|~|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])*([a-z]| [u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])))$/i.test(email);
}

The call is very simple:

Copy code The code is as follows:

if (isEmail('youremail@yourdomain.com')){ console.log( 'This is email is valid'); }

If it is server-side verification. Like php, the simplest one is:

Copy code The code is as follows:

/*
* Email address legality verification
*/

function isEmail($mail_address) {
return filter_var($mail_address, FILTER_VALIDATE_EMAIL);
}

But this matter can also be complicated.

Like this one. He established a complete system of email address verification websites. I guess few people do this.

To be honest, I have to admire it.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/676860.htmlTechArticleThere are many ways to verify email addresses. On the browser side, js email verification can be detected through regular expressions. For example: Copy the code The code is as follows: function isEmail(email) { return /^((([a...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to register an account on Ouyi Exchange Ouyi Exchange Registration Tutorial How to register an account on Ouyi Exchange Ouyi Exchange Registration Tutorial Apr 24, 2025 pm 02:06 PM

The steps to register an Ouyi account are as follows: 1. Prepare a valid email or mobile phone number and stabilize the network. 2. Visit Ouyi’s official website. 3. Enter the registration page. 4. Select email or mobile phone number to register and fill in the information. 5. Obtain and fill in the verification code. 6. Agree to the user agreement. 7. Complete registration and log in, carry out KYC and set up security measures.

Binance download link Binance download path Binance download link Binance download path Apr 24, 2025 pm 02:12 PM

To safely download the Binance APP, you need to go through the official channels: 1. Visit the Binance official website, 2. Find and click the APP download portal, 3. Choose to scan the QR code, app store, or directly download the APK file to download to ensure that the link and developer information are authentic, and enable two-factor verification to protect the security of the account.

How to register an account on Sesame Open Exchange? Tutorial on Registration of Sesame Open Exchange How to register an account on Sesame Open Exchange? Tutorial on Registration of Sesame Open Exchange Apr 24, 2025 pm 02:00 PM

Registering a Sesame Door Account requires 7 steps: 1. Prepare a valid email or mobile phone number and a stable network; 2. Visit the official website; 3. Enter the registration page; 4. Select and fill in the registration method; 5. Obtain and fill in the verification code; 6. Agree to the user agreement; 7. Complete registration and log in, it is recommended to carry out KYC and set security measures.

How to register an account on Binance Exchange Binance Exchange Registration Tutorial How to register an account on Binance Exchange Binance Exchange Registration Tutorial Apr 24, 2025 pm 02:03 PM

The steps to register a Binance account include: 1. Prepare a valid email or mobile phone number and a stable network; 2. Visit Binance official website; 3. Enter the registration page; 4. Select the registration method; 5. Fill in the registration information; 6. Agree to the user agreement; 7. Complete verification; 8. Obtain and fill in the verification code; 9. Complete registration.

Explain how to use sessions for user authentication. Explain how to use sessions for user authentication. Apr 26, 2025 am 12:04 AM

The session realizes user authentication through the server-side state management mechanism. 1) Session creation and generation of unique IDs, 2) IDs are passed through cookies, 3) Server stores and accesses session data through IDs, 4) User authentication and status management are realized, improving application security and user experience.

Sesame Open Web3 registration entrance and registration steps Sesame Open Web3 registration entrance and registration steps Apr 24, 2025 pm 01:06 PM

The Sesame Open Door Web3 registration portal is located on the "Register" button on the homepage of its official website. The registration steps include: 1. Visit the official website, 2. Click the "Register" button, 3. Fill in the registration information, 4. Verify the email, 5. Set up and connect to the digital wallet, 6. Complete the registration.

Ouyi Trading App Official Website Download Portal Ouyi Trading App Official Website Ouyi Trading App Official Website Download Portal Ouyi Trading App Official Website Apr 24, 2025 pm 02:15 PM

Through the following steps, you can safely access the Ouyi official platform and download the APP: 1. Use a trusted search engine to search for "Ouyi" or "OKX" to check the domain name; 2. Check the official social media account to obtain the URL; 3. Consult the official customer service to confirm the URL; 4. Use a trusted navigation website. When downloading the APP, visit the official website, find the download portal, choose how to scan the QR code, app store, or directly download the APK file, and pay attention to checking developer information, viewing user reviews, installing security software, beware of phishing websites and APPs from unknown sources, and protecting personal information.

Download the official website of Ouyi Exchange app for Apple mobile phone Download the official website of Ouyi Exchange app for Apple mobile phone Apr 28, 2025 pm 06:57 PM

The Ouyi Exchange app supports downloading of Apple mobile phones, visit the official website, click the "Apple Mobile" option, obtain and install it in the App Store, register or log in to conduct cryptocurrency trading.

See all articles