On 11-Nov-2003, Ankur Gupta <ag****@cc.gatech.edu> wrote:
$middle_conditions = " and upper(gsa_template_data_header) >=
'.\$start_selection.' and
upper(gsa_template_data_header) <= '.\$end_selection.'
order by upper(gsa_template_data_header) asc";
$new_middle_conditions = "";
$tok = strtok($middle_conditions,".");
while ($tok) {
if (strstr($tok, "$")==true)
{
eval ("$new_middle_conditions .=".$tok.";");
}
else
{
$new_middle_conditions .= $tok;
}
$tok = strtok(".");
}
if ($middle_conditions != "")
$middle_conditions = $new_middle_conditions;
Your code would work if you change the eval to the following:
eval ("\$new_middle_conditions .=".$tok.";");
because you weren't escaping the $ the variable $new_middle_conditions was
replaced in the string giving you the eval error.
However, you could also replace all of your code with
eval("\$middle_conditions = \"$middle_conditions\";");
The eval can process the whole string at once, there's no need for you to
parse it.
--
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to
ja*********@willglen.net (it's reserved for spammers)