2 array multiplication

Hello, input name " option[<?php echo $option['product_option_id']; ?>][width] " as I want 2 input multiplication, but it doesn’t crash. input name such please.

<?php 
    $height = null; 
    $width = null; 
    function vir2nok($data) { 
        return str_replace(",",".",$data); 
    } 
    if ($_POST) { 
        $height = vir2nok($_POST["height"]); 
        $width = vir2nok($_POST["width"]); 
        if (is_numeric($height) && is_numeric($width)) { 
            $sonuc = $height * $width; 
            echo $height." x ".$width." = ".$sonuc."<hr>"; 
        } 
    } 
?> 


<form action="" method="post"> 

<input type="text" name="option[<?php echo $option['product_option_id']; ?>][height]"  placeholder="<?php echo $label_height; ?>" id="input-option<?php echo $option['product_option_id']; ?>" class="pso-height-input form-control" />
<input type="text" name="option[<?php echo $option['product_option_id']; ?>][width]"  placeholder="<?php echo $label_width; ?>" id="input-option<?php echo $option['product_option_id']; ?>" class="pso-width-input form-control" />

 <input type="submit" name="gonder"> 
</form>

I need a question before I will help, not just code and a title.

I want the input to collect the value of 2 to be hit. input name should not be changed because the required code

So you are doing a post transaction. First step is to see how them come in.

print_r($_POST)

then call the function with those parameters.

Sponsor our Newsletter | Privacy Policy | Terms of Service