简单的注册表单.帮我调试mycode. PHP中的新功能 [英] simple signup form. help me debug mycode. new in php
本文介绍了简单的注册表单.帮我调试mycode. PHP中的新功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
此signup.php
this signup.php
<form method="post" action="reg.php">
<div id="formStyle">
<input type="text" name="email" placeholder="Enter your eMail">
<input type="password" name="pass" placeholder="Enter your desire Password">
<input type="text" name="fname" placeholder="Enter your First Name">
<input type="text" name="mname" placeholder="Enter your Middle Name">
<input type="text" name="lname" placeholder="Enter your Last name">
<button id="logButton" type="submit">Sign Up</button>
<div id="signButton">
<a class="signLinkStyle" href="login.php">Log In</a>
</div>
</div>
</form>
这是reg.php
this is reg.php
<?php
$con = mysqli_connect("localhost","root","123456");
mysqli_select_db("muchies");
if(mysqli_connect_errno())
{
echo "Failed to connect to mysql:" . mysqli_connect_error();
}
$sql = mysqli_query(
"INSERT INTO member (userMail,userPass,userFname,userMname,userLname)
VALUES (NULL,$_POST[email],$_POST[pass],$_POST[fname],$_POST[mname],$_POST[lname])"
);
if(!mysqli_query($con,$add))
{
die('Error: '.mysqli_error($con));
}
echo "added";
mysql_close($con);
?>
推荐答案
con = mysqli_connect(" ," ," ); mysqli_select_db(" ); 如果(mysqli_connect_errno()) { echo " . mysqli_connect_error(); }
con = mysqli_connect("localhost","root","123456"); mysqli_select_db("muchies"); if(mysqli_connect_errno()) { echo "Failed to connect to mysql:" . mysqli_connect_error(); }
sql = mysqli_query( "
sql = mysqli_query( "INSERT INTO member (userMail,userPass,userFname,userMname,userLname) VALUES (NULL,
_POST [email],
_POST[email],
这篇关于简单的注册表单.帮我调试mycode. PHP中的新功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文