On Mon, 2004-11-22 at 09:01 -0500, Al wrote:
> When handling $_POST[] values that may or may not be assigned, I am forever 
> using:
> 
> if((isset($_POST['courses_list']) AND $_POST['courses_list']== 'Used'))
> 
> Is there a shorthand way of doing this without causing notice errors?
> 
> Thanks.....
> 

You could write a function that would perform this for you.

function getPostVar($var)
{
    if (array_key_exists($var, $_POST) && isset($_POST[$var])) {
       return $_POST[$var];
    } else {
       return False;
    }

}

if (getPostVar('contact_list') == "Used")...

-- 
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*    --- Now supporting PHP5 ---
****************************************/

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to