Re: getting around the undefined index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ross wrote:
I have not found a satisfactory way of doing this yet!!!!

$text = $_REQUEST['text_size'];
if ($text) {
echo $text;
}

I send the $text_size variable to the browser with lines like...

<a href="<? $_SERVER['PHP_SELF']; ?>?text_size=small" class="size1" id="one">A</a>

When the page initially loads I get a undefined index error as it does not exist but is there a way of wrapping in in a switch statement or funtion so the variable is only used when $_REQUEST['text_size']; actually exists.

http://php.net/isset

-Stut

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux