Re: $command actions

From: Date: Sat, 14 Jun 2003 15:22:22 +0000
Subject: Re: $command actions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-151486@lists.php.net to get a copy of this message
$command = isset($HTTP_POST_VARS['action'] and $HTTP_POST_VARS['action'] == "data_input") ? "check" : "display"; Daniel J. Rychlik wrote:
I have a line of code in my form that I am trying to get to work. $action = ($HTTP_POST_VARS['action'] == "data_input") ? "check" : "display"; I recieved undefined action when running. So I did this. $command = isset($HTTP_VARS['action'] == "data_input") ? "check" : "display"; I recieve unexpected T_IS_EQUAL, expecting ',' or ')' Ive tried a couple different ways to isolate my syntax. I am using the example from http://www.zend.com/zend/spotlight/form-pro-php4.php Ive also read this document and I understand it. http://ca2.php.net/manual/en/language.expressions.php I know that is my syntax, I followed the example that Lars Torben Wilson <torben@php.net> gave me, and it worked great checking the isset before declaring in my form. Im hoping that this is just as simple. -Dan
-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.

« previous php.general (#151486) next »