Re: $command actions

From: Date: Sat, 14 Jun 2003 15:54:40 +0000
Subject: Re: $command actions
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-151490@lists.php.net to get a copy of this message
Whoops! $command = isset($HTTP_POST_VARS['action']) and $HTTP_POST_VARS['action'] == "data_input") ? "check" : "display"; Daniel J. Rychlik wrote:
I recieved a unexpected T_LOGICAL_AND, expecting ',' or ')'; ----- Original Message ----- From: "Leif K-Brooks" <eurleif@buyer-brokerage.com> To: "Daniel J. Rychlik" <drychlik@tcsconsult.com> Cc: <php-general@lists.php.net> Sent: Saturday, June 14, 2003 10:22 AM Subject: Re: [PHP] $command actions
$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.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- 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 (#151490) next »