JavaScript and PHP Verify that the user entered the URL address correctly, javascripturl_php tutorial

Source: Internet
Author: User

JavaScript and PHP Verify that the user entered the correct URL address, Javascripturl


This article describes the JavaScript and PHP authentication user input URL address is correct method, share for everyone for reference. Here's how:

1.javascript detection URL address validity:

Copy the Code code as follows:

2.PHP Detecting URL address validity

Copy the Code code as follows: <?
function Is_url ($STR) {
Return Preg_match ("/^http://[a-za-z0-9]+.[ a-za-z0-9]+[/=?%-&_~ ' @[] ': +!] * ([^<> "]) *$/", $str);
}
?>

We can use the file_get_contents () function to verify if we want to try a normal method.

I hope this article is helpful to everyone's PHP programming.


PHP user Input Verification code how to use JavaScript code to determine whether to enter the correct

Verification codes are usually generated randomly at the server, and the HTML page uses Ajax to obtain a verification code to compare with the user-entered verification code.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.