Hello all.The above code works just fine when I click on a link such as:Code:<?php switch ($_GET['lang']) { case "es": $txtGreeting = array("buenas dias"); break; case "fr": $txtGreeting = array("bon jour"); break; default: $txtGreeting = array("good day"); } ?>But if I click a link without the querystring (?lang=fr), I receive a nasty error message:Code:<a href="index.php?lang=fr">French</a>
"Undefined index: lang"
Could anyone explain to me how to determine if a querystring exists BEFORE performing the switch statement?
Or, if possible, how I could switch to default if the querystring is absent?
Many thanks.




Reply With Quote