html,php table only son value considerations

Source: Internet
Author: User
Tags php mysql

    1. 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.

    2. The HTML JS PHP MYSQL Character set is best unified.

    3. HTML JS PHP HTTP request must be in a uniform manner.

    4. 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>
    1. 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

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.