1
I’m having trouble with the header()
, I made a schedule to change the database data and when I click on the button to change it goes to a blank page then I put the header("Location: AdmAgenda.php");
so that you could return to the page already with updated data but is giving error:
The localhost page is not working
Excessive redirection by localhost Try to clear cookies.
What can I do to fix?
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));
}
?>
Is the redirect to the same page? Infinite loop?
– Papa Charlie
this... would have to go back to the page
– Nathan
Put a
if
to prevent you from entering the condition that makes the changes and redirect.– Papa Charlie
Already managed to solve?
– Jorge B.