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.