我想制作一个注册表格,我可以附加图像并在订阅结束时写入(数字或日期)
这是我的代码
if (isset($_POST['username'])){
$username = $_POST['username'];
$email = $_POST['email'];
$password = $_POST['password'];
$username = stripslashes($username);
$username = mysql_real_escape_string($username);
$email = stripslashes($email);
$email = mysql_real_escape_string($email);
$password = stripslashes($password);
$password = mysql_real_escape_string($password);
$trn_date = date("Y-m-d H:i:s");
$expira = $_Post[''];
$query = "INSERT into `users` (username, password, email, trn_date,expira) VALUES ('$username', '".md5($password)."', '$email', '$trn_date', '$expira')";
$result = mysql_query($query);
if($result){
echo "<div class='form'><h3>You are registered successfully.</h3><br/>Click here to <a href='login.php'>Login</a></div>";
}
}else{
?>
这是提交表格
<form name="registration" action="" method="post">
<input type="text" name="username" placeholder="Username" required />
<input type="email" name="email" placeholder="Email" required />
<input type="text" name="expira" placeholder="Data de Expirare al cardului" required />
<input type="password" name="password" placeholder="Password" required />
<input type="submit" name="submit" value="Register" />
</form>
$ expira = $ _Post ['']是订阅结束的日期。它也在输入中。
但是对于图像我没有做任何事情,因为我没有找到任何教程。