The following link exists.
<a style='color: bfbfbf; text-decoration: none;' href='autorizar.php?id=<?php echo $curso[0]['idCurso'].'&resp=s' ?>'>Sim</a>
If the yes was clicked the variable resp = 's', if it is not clicked, resp = 'n'
Authorize page
<?php include '../AB/ab.php';
$id = $_GET['id'];
$resp = $_GET['resp'];
function autorizar($conexao, $id)
{
if($resp == 's')
{
$sqlAtrib = "UPDATE cursos SET exibirCurso='s' WHERE idCurso = $id";
mysqli_query($conexao, $sqlAtrib);
header("Location: curso2.php?curso=$id");
}
else
{
echo 'entrou no else';
}
}
autorizar($conexao, $id);
?>
However, only $ _GET ['id'] is working. And the error returned is that the resp variable could not be found.
Notice: Undefined variable: resp in C: \ Program Files (x86) \ EasyPHP-Devserver-16.1 \ eds-www \ Accipiter \ Commercial \ autorizar.php on line 8
I think it's an easy error error, but I can not resolve it.