一切正常。 错误日志未显示任何内容。 Stripe告诉我它创建成功。 但是我在自己的数据库中没有任何条目。 另一方面,登录效果很好。整个后端工作正常。有什么已知的错误或我在这里错过的东西吗?
session_start();
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once('Stripe');
require_once('db.php');
mysqli_set_charset($mysqli,"utf8");
if ($stmt = $mysqli->prepare('SELECT ID, password FROM accounts WHERE email = ?')) {
$stmt->bind_param('s', $_POST['email']);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows > 0) {
echo 'email exists, please choose another!
Back';
} else {
if ($stmt = $mysqli->prepare('INSERT INTO accounts (email, password, customer) VALUES (?, ?, ?)')) {
$customer = \Stripe\Customer::create([
"email" => $_POST['email'],
]);
$uniqid = uniqid();
$_SESSION['email'] = $_POST['email'];
$password = hash('sha512',$_POST['password']);
$stmt->bind_param('sss', $_POST['email'], $password, $customer->id );
$stmt->execute();