<?php
session_start();
$db = mysqli_connect('localhost', 'root', '', 'register');
$name = $_SESSION['name'];
$password = $_SESSION['password'];
$id = "";
$block = "";
if(isset($_POST['deposit'])){
$id = $_POST['id'];
$wal = $_POST['wallets'];
$amount = $_POST['dep-amount'];
function getToken($length){
$token = "";
$codeAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$codeAlphabet.= "abcdefghijklmnopqrstuvwxyz";
$codeAlphabet.= "0123456789";
$max = strlen($codeAlphabet); // edited
for ($i=0; $i < $length; $i++) {
$token .= $codeAlphabet[random_int(0, $max-1)];
}
return $token;
}
$d_key = getToken(34);
$status = "Processing";
$time = date("Y-m-d H:i:s");
mysqli_query($db, "INSERT INTO deposit (amount, currency, address, status) VALUES ('$amount','$wal','$d_key','$status') ");
}
$con = mysqli_query($db, "SELECT * FROM deposit WHERE id = '$id' ");
$row = mysqli_fetch_array($con);
$block = "<div class='dep-modal'><div class='container'><div class='dep-content'><span class='close'>X</span><span class='number'>Payment # ".$status.$time."</span>
<span class='d-text'>Send exactly ".$amount.$wal." at</span>
<span class='d-key'><input type='text' name='d-key' value='".$d_key."'></span>
<span class='bottom-text'>Your payment will be completed after confirmation by the network. Confirmation time may vary and depends on the Commission</span>
</div>
</div>
</div>";
?>
Почему не пишутся данные в БД?