Home  >  Article  >  Backend Development  >  PHP verifies whether user registration information is legal_PHP tutorial

PHP verifies whether user registration information is legal_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:39:031360browse

Key functions

When verifying the legality of user registration information through JavaScript, it is often necessary to check numerical data.

JavaScript can use the isNaN() function to achieve the above functions. This function is explained below.

isNaN() function

Used to determine whether the parameters of the function are numerical data. It returns False, otherwise it returns True.

Grammar

bool isNaN(var)

The parameter var is the data to be judged.

Function implementation

After the user fills in the registration information, in order to ensure the legitimacy of the information, the information should be verified. Verification of the legality of registration information can be implemented using PHP code or JavaScript. Developers can choose based on the actual situation. If they are worried about the client browser's restrictions on JavaScript, they can use PHP code to implement it. However, using this method to verify the registration information is done in the server, so a lot of time will be wasted. Server resources. The application of JavaScript scripts to verify the user's registration information is implemented by the client browser, so it will save server resources to a large extent. This site's verification of user registration information is implemented through JavaScript. When writing the user registration information verification module, encapsulate the code for user registration information verification into the custom function chkinput login(), and call this function in the onSubmit event of the form "form" mark. The Chkinput login() function The code is as follows.

The following is

以下为 include_once("top.php");
?>


 

   

     
       
   
   

               include_once("left.php");
    ?>