我的一些 PHP 似乎有问题。它从 HTML 页面获取数据,然后将其添加到 MySQL 数据库中,但信息不会出现。
<?php
// Variables
$email = $_POST["email"];
$username = $_POST["username"];
$password = $_POST["password"];
$passwordconfirmation = $_POST["passwordconfirmation"];
// Failure
if ($password !== $passwordconfirmation)
{
echo "The password fields do not match. Please enter your password again.";
}
// Success
else
{
$connection = mysqli_connect("*****.com", "*****", "*****", "charlesfriessdatabase"); // Connect
// Error Message
if (!$connection)
{
die ("Error");
}
mysqli_query("INSERT INTO accounts (email, username, password) VALUES ($email, $username, $password)"); // Inserter
mysqli_close($connection); // Connection Closer
echo "You have successfully signed up! Please check your email to confirm your account."; // Success Message
}
?>