when I disable my date-picker input type when i echo the variable that has the values it doesn't show the correct data , appears 1970-01-01 but when i delete the disable tag from the input It starts working fine can you explain me why and help me solving this problem?
<html>
<div class="two-col">
<div class="col1">
<label class="label1" style="font-size:20px" for="name"> Data de Criação</label>
<input onkeypress="javascript:return false;" type="text" name="pdatacri" id="pdatacri" class="IP_calendar" title="Y-m-d" placeholder="Ano-Mes-Dia" value="<?php echo $datacri; ?>" style="width:200px;">
</div>
<div class="col2">
<label class="label1" style="font-size:20px" for="name"> Data de Publicação</label>
<input onkeypress="javascript:return false;" type="text" name="pdatapub" id="pdatapub" alt="Data de Publicacao" class="IP_calendar" title="Y-m-d" placeholder="Ano-Mes-Dia" style="width:200px;" value="<?php echo $datapub; ?>">
</div>
</div>
</html>
PHP file
<?php
$datacri = mysqli_real_escape_string($link, $_POST['pdatacri']);
$datacri = date('Y-m-d', strtotime(str_replace('-', '/', $datacri)));
$datapub = mysqli_real_escape_string($link, $_POST['pdatapub']);
$datapub = date('Y-m-d', strtotime(str_replace('-', '/', $datapub)));
echo $datacri;
echo $datapub;
<?
If you need more code ask for it. Thanks and have a nice day :)!