"jskeith1" wrote:[color=blue]
> i have a program that will display a number of diffferent
> results
> depending on the situation.
>
> one example of the code looks like
>
> <?php if(isset($_SESSION['cust'])) {
>
> print 'You entered: ' . $_SESSION['cust'] . NL . NL;
>
> } else {
>
> print NL . NL;
> }
> $customer->AddDataPart("New Customer Name: <br>");
> $customer->AddInputPart("cust");
> $customer->AddDataPart("<br>");
> $customer->AddInputPart("submit");
> $customer->AddInputPart("reset");
> $customer->AddInputPart("_submit_check");
>
> unset($_SESSION['cust']);
>
> session_destroy();
>
> }
>
> $error = $customer->Output(array(
> "Function"=>"displayForm",
> "EndOfLine"=>"n"
> ));
>
> ?>
>
> i want to assign this code to a variable (other code will be
> assigned
> to the same variable depending on what if/wlse branch it ends
> up on.
>
> what is the best way to assign this to a variable in such a
> way that it
> will be understood as php when the variable is called in the
> final
> code? do i need multiple include statements for each possible
> if/else
> outcome?
>
> if so, what is the best way to assign an include page to a
> variable?
>
> tia...
>
> ps - i'm using a forms class here, hence, the code looks the
> way it
> does.[/color]
use php’s "eval"
--
Posted using the
http://www.dbforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL:
http://www.dbforumz.com/PHP-setting-...ict188595.html
Visit Topic URL to contact author (reg. req'd). Report abuse:
http://www.dbforumz.com/eform.php?p=639932