I would like to limit the selection of input date in this way, but it is not working.
<script type="text/javascript">
var data = new Date();
var dia = data.getDate();
var mes = data.getMonth();
var ano4 = data.getFullYear();
var str_data = ano4 + '-' + (mes+1) + '-' + dia;
<?php $data=str_data;?>
</script>
<input type="date" name="data" max="<?=$data?>"/>