Помощь с массивами

like-cupon

Новичок
Доброго времени суток, форумчане помогите разобраться с кодом оплаты.
Как сделать чтоб $amount = 1595 сумма заносилась в массив с формы <input type="text" name="<?php echo $amount; ?
т е какую сумму ввёл та и пошла в масив.




PHP:
<?php

// Занесение параметров в массив

$array = array (

$amount =  1595,
$payment = $random_string = shapeSpace_random_string(6),
$shop = 1421,
$currency = 'rub',
$desc = 'Pay in',
$secret = '9ae04dd8cac9acc590370b798b3d883e' //Ваш секретный ключ

);

// Соединение массива в строку и хеширование функцией md5
$sign = md5 ( implode ( '|', $array ) );

?>

<?php

function shapeSpace_random_string($length) {
    
    $characters = "123456789";
    
    srand((double)microtime()*1000000);
    
    $random = '';
    
    for ($i = 0; $i < $length; $i++) { 
        $random .= $characters[rand() % strlen($characters)]; 
    }
    
    return $random;
      
}
?>
    <form action='https://payok.io/pay' method= 'POST'>

 <span  style="padding:10px; font-size:18px; display:inline-block;">
            <div class="arrow">Введите сумму для оплаты:</div>
        </span>
        <input type="text" name="<?php echo $amount; ?>" value= "" id="oa" step="0" min="1000" max="100000" required=""  onchange="calculate(this.value)" onkeyup="calculate(this.value)" onfocusout="calculate(this.value)" onactivate="calculate(this.value)" ondeactivate="calculate(this.value)" style="font-size: 15px;line-height: 2;letter-spacing: 0em;font-weight: 400;font-style: normal;border-radius: 5px;">
        <span></span>
<span  style="padding:10px; font-size:18px; display:inline-block;">руб</span>   
          
<input type='hidden' name= 'payment' value= "<?php echo $payment; ?>">
<input type='hidden' name= 'shop' value= "<?php echo $shop; ?>">
<input type='hidden' name= 'currency' value= "<?php echo $currency; ?>">
<input type='hidden' name= 'desc' value= "<?php echo $desc; ?>">
<input type='hidden' name= 'email' value= '<? echo $row[6] ?>' >
<input type='hidden' name= 'method' value= 'cd' >
<input type='hidden' name= 'myparam' value= '<? echo $row[0] ?>' >
<input type='hidden' name= 'anotherparam' value= '<? echo $l; ?>' >
<input type='hidden' name= 'sign' value= "<?php echo $sign; ?>">
<span><input type="submit" id="submit" value="ОПЛАТИТЬ"  style="padding:10px; font-size:18px; border-radius: 5px;"></span>

</form>
 
Сверху