Jump to content

tenary operator issue


HDFilmMaker2112

Recommended Posts

For some reason the first ternary operator is evaluating to false and running true for the second one, when $_SESSION['myusername']is set. Anybody see anything in the code below or is this an issue with the sessions being set.

 

<? echo (isset($_SESSION['myusername'])) ? '<a href="'.$page.'.php?films">Films' : (isset($_SESSION['myusername2'])) ? '<a href="'.$page.'.php?contact">Contact' : '<a href="'.$page.'.php?donate">Donate'; ?></a>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.