Home > front end >  About the form cannot be written to the database, the code without error, is cannot be written to th
About the form cannot be written to the database, the code without error, is cannot be written to th

Time:01-29

  //formsubmit HTML



<meta charset="utf-8" & gt;
<meta name="viewport" content="width=device - width, initial - scale=1.0" & gt;
The form submission & lt;/title> <br/></head> <br/><br/><body> <br/><br/><Fieldset style="width: 800 px; margin: 0 auto; The font - size: 14 px;"> <br/><Legend> User registration & lt;/legend> <br/><The form action="../the js22 \ PHP \ postformdata PHP "method=" post "& gt; <br/><P> <The label for="" & gt; User name: & lt;/label> <Input type="text" name="username" & gt; </p> <br/><P> <The label for="" & gt; Secret code: & lt;/label> <Input type="text" name="password" & gt; </p> <br/><P> <The label for="" & gt; Mail box: & lt;/label> <Input type="text" name="email" & gt; </p> <br/><Input type="submit" value="https://bbs.csdn.net/topics/" & gt; <br/></form> <br/></fieldset> <br/></body> <br/><br/></html> <br/>//postformdata. PHP <br/><? PHP <br/><br/>//include "common. PHP";//introduction of the database connection <br/>The header (' the content-type: text/HTML. charset=utf-8'); <br/><br/>Define (' HOST ', 'localhost');//set the host name <br/>Define (' USERNAME 'and' root ');//set the user name <br/>Define (' PASSWORD ', '123');//set the password <br/>Define (' DBNAME ', 'the js22');//set the database name <br/><br/>$common=new mysqli (HOST, USERNAME, PASSWORD, DBNAME);//connect to the database objects <br/>If ($common - & gt; Connect_error) {<br/>Die (' database connection failed. $conn - & gt; Connect_error);//output information and exit <br/>} <br/>//die (" database connection success "); <br/><br/>If (isset ($_POST [' username ']) & amp; & Isset ($_POST [' password ']) & amp; & Isset ($_POST [' email '])) {<br/>$user=$_POST [' username ']. <br/>$pass=$_POST [' password ']; <br/>$email=$_POST [' email ']; <br/>//echo "my name is: $user, the password is: $pass, mailbox is: $email". <br/>$common - & gt; Query (" insert into the registry values (null, '$user', '$pass', '$email', NOW ()) "); <br/>Echo "registration"; <br/>} else {<br/>The exit (' illegal operation); <br/>} <br/>//echo $user; <br/><br/>//code and path should be no problem, no error code, <br/><p class="article - content rp"> CodePudding user response: </p>If conditions are not meet, this is the PHP code, how to js BBS </div> <div class="th_page th_page_color"></div> <div class="umCopyright"> <p>Page link:<a href="/frontend/100398.html" target="_blank" style="color:#999">https//www.codepudding.com/frontend/100398.html</a></p> </div> <div class="detail-arr"> <div class="detail-arr-left">Prev:<a href='/frontend/100397.html'>Embedded in the Google browser exe program written in c or qt</a></div> <div class="detail-arr-right">Next:<a href='/frontend/100399.html'>Write text LayUI time selection box underside</a></div> </div> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="hot-tags neitags"> <ul> <li><i class="iconfont icon-x-tags"></i> Tags:  </li> <a href='/e/tags/?tagname=JavaScript' target='_blank'>JavaScript</a> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="xiangguan"> <ul class="msg msghead"> <li class="tbname">Related</li> </ul> <ul> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="flinks"> <ul> <li><i class="iconfont icon-x-tags"></i> Links:  </li> <li class="liflinks"><a target="_blank" href="/" title="CodePudding">CodePudding</a></li> </ul> </div> </div> </div> </div> <div class="footer"> <p><span style="font-size:16px;color:#666;font-weight: bold">About Us:</span>  <a href="https://www.codepudding.com/contact.html">Contact Us</a>      <a href="https://www.codepudding.com/service.html">Terms of Service</a>      <a href="https://www.codepudding.com/privacy.html"> Privacy Policy</a></p> <p class="foot_info">Copyright © 2010-2023,Powered By <a href="/" target="_blank">CodePudding</a> </p> </div> <script type="text/javascript" src="/skin/code/tianhu.js"></script> </body></html>