input range materialize does not take the value of a php variable

1
<?php 

$estatus = $resultado['status'];

 echo '<p class="range-field">


     <input type="range"   value= "$estatus" disabled>

    </p>';
echo $estatus;

    ?>

I use the following lines to show a bar that will indicate the status of a request using materialize.

I'm showing by echo the value of the $ status but I'm not taking it in the meter.

What I do not understand is that the printed value is not taken by the meter.

after indicating a minimum and maximum does not work is placed in the 6

<input type="range"   value="$estatus" min="1" max="10" >

    
asked by Juan Ortiz 29.10.2018 в 00:01
source

1 answer

2

The problem is that you are assigning value "$ status" as a string. You are not assigning the value of the variable.

Try doing the following:

<?php 

$estatus = $resultado['status'];

 echo '<p class="range-field">
            <input type="range"   value= "'.$estatus.'" disabled>
      </p>';
echo $estatus;

  ?>

In this way we are concatenating the value of the variable. With that, it should be solved. Greetings!

    
answered by 29.10.2018 / 01:09
source