0
There is the following link.
<a style='color: bfbfbf; text-decoration: none;' href='autorizar.php?id=<?php echo $curso[0]['idCurso'].'&resp=s' ?>'>Sim</a>
If yes was clicked the variable Resp = ’s', if no is clicked, Resp = 'n'
Page authorize
<?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 it was not possible to find the Resp variable.
Notice: Undefined variable: Resp in C: Program Files (x86) Easyphp-Devserver-16.1 eds-www Accipiter Commercial authorize.php on line 8
I believe it’s a mistake mine easy to resolve, but I’m not getting it right.
That’s right! I forgot to pass by parameter! Mistake that should not be made long ago! haha vlw!
– Bsalvo