I'm having problem with header()
, I made a schedule to change the data in the database and when I click the button to be able to change it goes to a blank page so I put header("Location: AdmAgenda.php");
so that it could go back to the page already with data updated but giving error:
The localhost page is not working
Excess redirect by localhost Try to clear cookies.
What can I do to fix it?
My code:
<?php
$idSeg = filter_input(INPUT_GET, "id-segunda");
$seg = filter_input(INPUT_GET, "seg");
$idTerca = filter_input(INPUT_GET, "id-ter");
$tercaa = filter_input(INPUT_GET, "ter");
$idQuarta = filter_input(INPUT_GET, "id-quarta");
$quartaa = filter_input(INPUT_GET, "qua");
$idQuinta = filter_input(INPUT_GET, "id-quinta");
$quintaa = filter_input(INPUT_GET, "qui");
$idSexta = filter_input(INPUT_GET, "id-sexta");
$sextaa = filter_input(INPUT_GET, "sex");
$idSabado = filter_input(INPUT_GET, "id-sabado");
$sabadoo = filter_input(INPUT_GET, "sab");
include("conexao.php");
if($link) {
$segg = mysqli_query($link, "UPDATE horas_segunda set horas_de_segunda='$seg' where id='$idSeg';");
$terc = mysqli_query($link, "UPDATE horas_terca set horas_de_terca='$tercaa' where id='$idTerca';");
$quarr = mysqli_query($link, "UPDATE horas_quarta set horas_de_quarta='$quartaa' where id='$idQuarta';");
$quinn = mysqli_query($link, "UPDATE horas_quinta set horas_de_quinta='$quintaa' where id='$idQuinta';");
$sexx = mysqli_query($link, "UPDATE horas_sexta set horas_de_sexta='$sextaa' where id='$idSexta';");
$sabaa = mysqli_query($link, "UPDATE horas_sabado set horas_de_sabado='$sabadoo' where id='$idSabado';");
header("Location: AdmAgenda.php");
}
else{
die("Erro: " .mysqli_error($link));
}
?>