: This article describes php regular expression verification (email address, Url address, phone number, and zip code). If you are interested in PHP tutorials, refer to it. The content to be verified in this example is as follows: email address, Url address, phone number, and zip code. the verification method is for you
The QQ website has a website report function. After reading some js code, I thought it was well written and I won it. Below is an email verification and url verification JavaScript code, share it with you for email address verification
The Code is as follows:
Function checkEmail (){Var email = $. trim ($ ("# report_
number, if the same, the explanation passed, otherwise it is invalid ID number if(Idcardlast = =Idcardy[idcardmod]) {Alert ("Congratulations passed the verification!" "); } Else{alert ("Wrong ID number!" "); } } } } Else{alert ("ID card format is incorrect!"); }}/** can only be a positive integer*/varRegNum =/^\d+$/;/** ZIP Code*/varRegpostcode =/^\d{6}$/;/** User name * can only be alphanumeric underline, and star
The following collection of people commonly used in the development of a variety of forms to verify the function, including a mailbox, telephone, IP, website, date, ID, etc., I hope to help you
#region Verify Mailbox Authentication mailboxes
/**////Verifying mailboxespublic static bool Isemail (string source){return Regex.IsMatch (source, @ "^[a-za-z0-9] ([_.-]?[ a-za-z0-9]+) @ ([a-za-z0-9]+) ([.-]?[ a-za-z0-9]+) *). ([A-za-z]{2,}) $ ", regexoptions.ignorecase);}public static bool Hasemail
You can use the url rewriting mechanism to change the verification code.
URL rewriting mechanism: to ensure that the address of a url is unique, you can transmit different parameters to the server each time.
The header information of a data request can be analyzed as follows: the header information includes the http pr
This article mainly introduces how Codeigniter performs URL redirection after user login verification. For more information, see
This article mainly introduces how Codeigniter performs URL redirection after user login verification. For more information, see
Codeigniter processes the
DOCTYPE HTML>HTML>Head>MetaCharSet= "Utf-8">title>Beginner's Tutorial (runoob.com)title>Scripttype= "Text/javascript"> functionSave () {alert ("block A-tagged href request submission 1"); This only simulates the verification process before the form is submitted, and the real JS verification code can be written in the Save () method - }Script>Head>Body> P>Click on the link below to view the results:
The previous use of PHP to verify that the mailbox, URL, IP is legitimate through their own write regular to achieve, but sometimes the brain faint, may write a not exactly the correct regular, leading to validation errors, today found that PHP itself with the verification mailbox, URL, IP is legitimate function.The main use is the Filter_var function.Grammarfilt
This article mainly introduces Codeigniter to implement URL redirection after handling user login verification. if you need it, refer to the CI framework.
Codeigniter processes the URL jump after User login verification. it mainly involves the My_Controller.php page and the logon authentication module User. php page.
.$text = Preg_replace (' @ https?:/ /([-\w\.] +) + (: \d+)? (/([\w/_\.] * (\?\s+)?) @ ', '
Example 2 directly extracts the URL address in
The
code is as follows
copy code
function match_links ($document) { Preg_match_all ("' while ($key, $val) = each ($links [2])) { if (!empty ($val)) $match [' link '] [] = $val; } while (the list ($key, $val) = each ($links [3])) { if (!empty ($val)) $match [' link
This article mainly introduces how Codeigniter performs URL redirection after user login verification. If you need it, refer to Codeigniter to process URL redirection after user login verification, it mainly involves the My_Controller.php page and the logon authentication module User. php page, the specific code is as
CodeIgniter processing user login Verification URL jump, mainly related to the my_controller.php page and login Verification Module user.php page, the specific code is as follows:
my_controller.php page:
Copy the Code code as follows: Class My_controller extends Ci_controller{Public Function __construct (){Parent::__construct ();/* Determine whether to log in an
-(\ d00000000.html " ); Match m = Reg. Match (filename ); If (M. Success ){ String Id = M. Groups [ 1 ]. Value; app. Context. rewritepath ( " Homedetail. aspx? Id = " + ID );} // App. Context. response. Write (filename ); }
First obtain the virtual path of the current request, then obtain the specific file name, extract the ID from the regular expression, and finally rewrite the path.The homelist. ASPX page is processed as follows:
Original conversion address -->
A feature recently used for development is actually a very simple user input, and then the database is automatically searched for and a data reply. This is not a big problem with the official team, however, I have made a lot of effort in Token verification failure. I will give you an analysis on the Solution Below. A feature recently used for development is actually a very simple user input, and then the database is automatically searched for and a da
Url verification code $ str % C3 % F7 % D0 % C7 % CD % AC % BF % EE % D7 % B0 % B1 % B8; $ strurldecode ($ str ); nbsp; If the above two lines of code are saved in gbk, the display is positive. if the code is saved as utf, the display is abnormal. why? How can the code be properly stored as utf? ------ solution -------------------- available url
Codeigniter processes the URL jump after User login verification. It mainly involves the My_Controller.php page and the logon authentication module User. php page. The specific code is as follows:
My_Controller.php page:
Copy codeThe Code is as follows: class MY_Controller extends CI_Controller{Public function _ construct (){Parent: :__ construct ();/* Determine whether to log on and whether the current
Code for Codeigniter to process URL redirection after user login verification
Class MY_Controller extends CI_Controller
{
Public function _ construct ()
{
Parent: :__ construct ();
/* Determine whether to log on and whether the current URL is auth/login */
If (! $ This-> tank_auth-> is_logged_in ()
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.