Posted by Alan Little on 12/18/53 11:48
Carved in mystic runes upon the very living rock, the last words of
Jerry Stuckle of comp.lang.php make plain:
> Rik wrote:
>> Baron Samedi wrote:
>>
>>>1) oops, I didn't know that about the single quotes. Thanks.
>>>
>>>What did you mean by "escape the $ for $condition " ?
>>
>> In:
>> eval("$condition = ($text)? true : false;");
>>
>> PHP will try to search for the variable "condition" to put in the
>> eval statement.
>>
>> Escaping it like:
>> eval("\$condition = ($text)? true : false;");
>>
>> will let PHP know it has to treat this part as text
>
> How about:
>
> $condition = (eval ($text)) ? true : false;
That gives a parse error in the eval, as 2==3 is not a syntactically
valid PHP statement.
--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Navigation:
[Reply to this message]
|