It works local with xampp. The login works live, but the register does not

Refresh

March 2019

Views

6 time

0

Everything works fine. The error log does not show a thing. Stripe tells me that it were created successfully. But i have no entry in my own database. On the other side the login works perfectly well. And the whole backend is working fine. Is there any known error or something i missed here?

  

       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();

0 answers