Re: quick question about using capital letters coding w/ PHP

From: Date: Sun, 24 Jul 2005 21:30:40 +0000
Subject: Re: quick question about using capital letters coding w/ PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-219276@lists.php.net to get a copy of this message
* Bruce Gilbert <webguync@gmail.com>: > I am well versed in coding with xhtml which requires all lower case > and am pretty much a newbie at PHP so that is why I am asking this > question. > > is this acceptible > > if ($_post [sender_email] == "") or does at have to be if ($_POST > [sender_email] == "") > > in short, do uppercase and lowercase always have the same meaning. PHP is case sensitive. Additionally, quotes, or the absense of quotes, can change the context. I bring this up because the example you have above, $_post[sender_email] contains two errors: * $_post will likely be empty, whereas the PHP superglobal $_POST will likely contain the data you're looking for ;-) * $_post[sender_email] refers to the value in the $_post array returned by an array key that is the same name as the value of the constant sender_email. You almost certainly were actually meant $_POST['sender_email'] (note the quotes), which would refer to the value associated with the array key 'sender_emaail' in the $_POST array. You should probably do some reading in the introductory chapters of the PHP manual, specifically the variables section: http://php.net/variables Cheers! -- Matthew Weier O'Phinney Zend Certified Engineer http://weierophinney.net/matthew/

« previous php.general (#219276) next »