Newbie - Undefined Index Variable

From: Date: Fri, 07 Mar 2008 19:59:52 +0000
Subject: Newbie - Undefined Index Variable
Groups: php.general 
Request: Send a blank email to php-general+get-271145@lists.php.net to get a copy of this message
I have this: <?php if (trim($_SESSION['nowtoctype']) == 'thistype') {print '<a href="page1.php">page1</a>';}else{print '<a href=" page2.php">page2</a>';} ?> I will get the error: Notice: Undefined index: nowtoctype in ... If the variable has not yet been defined... Is there a way to check if this var is already defined? ... (and then I can define it - if not) -- Thanks - RevDave Cool @ hosting4days . com [db-lists]

« previous php.general (#271145) next »