Form items must add the Name property, and both POST and get values are obtained by using the Name property to pass parameters. Do not set the Name property to get a value that is not.
The HTML JS PHP MYSQL Character set is best unified.
HTML JS PHP HTTP request must be in a uniform manner.
Example:
HTML code:
<form id= "Reg_form" method= "post" action= "reg_submit.php" onsubmit= "return Check_form (This) " name=" Reg_form "> <input type= "text" id= "Username_input" name= "Username_input" Onblur= "Check_username ()" onkeyup= "Check_username ()"/> <input type= " Text " id=" Email_input " name=" Email_input "onblur=" Check_email () " onkeyup=" Check_email () "/ > <input type= " Password " id=" Password_input " name=" Password_input " onblur=" Check_password () " onkeyup=" Check_password () " /> < input type= "Password" id= "Repassword_input" name= "Repassword_input" onblur= "Check_repassword ()" onkeyup= "Check_repassworD () " /> <input Type= "text" id= "Name_input" name= "Name_input" /> <input type= "Submit" id= "Tijiao" value= " name=" Tijao "/> <input type=" Button " id=" Quxiao " value=" " name=" Quxiao "/> <input type=" Hidden " id=" Username_check " value=" 0 "/> <input type=" hidden " Id= "Email_check"/ value= "0" > </form>
-
PHP code:
<?phpheader ("Content-type: text/html; charset=utf-8"); error_reporting (0); $username _value = $_post[' username_input '; $email _value = $_post[' Email _input ']; $password _value=$_get[' password_input '; $name _value=$_post[' name_input '];include (' data/conn.php ');//$ Regdate = time (); $sql = "Insert into t_user (f_username,f_email,f_password,f_name VALUES (' $username _value ', ' $email _value ', ' $password _value ', ' $name _value ') "if (mysql_query ($sql, $conn)) { echo $username _value; //echo $sql; SQL statement when printing is executed //echo $ password_value;//Print Pass the password value exit (' User Congratulations registration success! Click here to <a href= "login.html" > Login </a> '); else { echo ' Sorry! Failed to add data: ', mysql_error (), ' <br /> '; echo ' click here to <a href= ' Javascript:history.back (-1); " > Return </a> retry ';}?
This article is from the "Cheng Technology blog" blog, make sure to keep this source http://zhengshuheng.blog.51cto.com/1439780/1585743
html,php table only son value considerations