The goal is to display one link or another based on the value of a variable sent by get.
- On page reload if there is no "value" request, $value is FALSE. As value is false the high link has visible class and the Cancel link has hidden class
- When clicking on Add, we send by get true as the value of "value" and when reloading the page the Add link is hidden and the Cancel link is visible
- When clicking Cancel, we send by get false as value of "value" and when reloading the page, although the $value is false, THE CANCEL LINK STILL APPEARS WITH CLASS VISIBLE AND THE HIGH LINK AS HIDDEN
QUESTION:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-
scale=1.0">
<style>
.oculto{
display:none;
}
.visible{
display:block;
}
</style>
<title>Document</title>
</head>
<body>
<?php
$valor = isset($_REQUEST["valor"]) ? $_REQUEST["valor"]:false;
print $valor." valor";
?>
<a href="get.php?valor=true" class=<?php echo $valor ?
'oculto':'visible'?>>Alta</a>
<a href="get.php?valor=false" class=<?php
echo $valor ? 'visible':'oculto'?>>Cancelar</a>
</body>
</html>