Eliminare resubmit form la refresh
Scris: Mie Oct 18, 2017
Salutare,
Am urmatorul cod:
Problema mea apare in momentul in care dau refresh paginii web, in chrome apare mesaul: confirm form resubmission
Cum pot elimina acest mesaj?
Multumesc!
Am urmatorul cod:
Cod: Selectaţi tot
<?php
if(isset($_POST['submit'])){
$an = $_POST['an'];
$id_furnizor = $_POST['id_furnizor'];
$array_fnc = getValoriFacturiFurnizori($database, $an, $id_furnizor);
if(array_key_exists($id_furnizor, $array_fnc)) {
$test = $array_fnc[$id_furnizor][2];
}
else {
$test = 'nu sunt valori';
}
}
?>
<form action="" method="post">
<select name="an" class="selectpicker">
<?php
$primul_an = date ("Y")-5;
$ultimul_an = date ("Y");
for( $i = $primul_an; $i <= $ultimul_an; $i++ ) {
$selected_an = ($ultimul_an == $i) ? 'selected="selected"' : '';
echo "<option $selected_an value='$i'>$i</option>\n";
};
?>
</select>
<select id="id_furnizor" name="id_furnizor" class="selectpicker" data-live-search="true">
<?php
foreach (getFurnizori($database) as $index => $value){
echo "<option value='$index' >$value</option>";
}
?>
</select>
<script type="text/javascript">
document.getElementById('id_furnizor').value = "<?php echo $_POST['id_furnizor'];?>";
</script>
<input name="submit" type="submit" class="btn btn-info" />
</form>
<?php echo $test; ?>
Cum pot elimina acest mesaj?
Multumesc!