I assigned a value “ventas” to $_SESSION[“area”] and when I echo it for testing I get the value. But when using it on a switch it doesnt bring the echo back. Am I doing something wrong? Missing something?
Here’s my code:
<?php
session_start();
echo $_SESSION["area"];
switch($_SESSION["area"])
{
case "ventas":
echo "ventas";
break;
}
?>
Thanks!
You need to make that session = a value, or it would just return NULL or won’t find anything in the switch. It seems it isn’t a correctly assigned value.