On Fri, Mar 7, 2008 at 2:59 PM, revDAVE <[EMAIL PROTECTED]> wrote:
> 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 ...

    Check out isset(): http://php.net/isset

<?php
    if(isset($_SESSION['nowtoctype']) && trim($_SESSION['nowtoctype'])
== 'thistype') {
        echo "<a href=\"page1.php\">Page 1</a>\n";
    } else {
        echo "<a href=\"page2.php\">Page 2</a>\n";
    }
?>

-- 
</Dan>

Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to