$smarty->assign problem
| From: | John Nichel | Date: | Mon, 13 Sep 2004 21:06:56 +0000 |
| Subject: | $smarty->assign problem | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-11804@lists.php.net to get a copy of this message | ||
Hi list,
I have this bit of code below, and I'm pulling my hair out because of it. Basically, I'm trying to assign a value if a certain form variable is posted. However, the $smarty->assign ( "foo", "bar" ); inside of that first if statement does not do anything (it does echo out 'yes', so I know the if statement is being executed). The second if statement (if 1 == 1) works fine, and smarty sets that variable with value, as does the last $smarty->assign which isn't in an if statement. It's driving me crazy...can anyone shed some light on why the $smarty->assign in the first if statement may not be working? TIA.
if ( isset ( $_POST['customzip'] ) && is_numeric ( $_POST['customzip'] ) ) {
if ( is_array ( $userinfo ) ) {
$userinfo['s_zipcode'] = $_POST['customzip'];
} else {
$userinfo = array (
"s_zipcode" => $_POST['customzip']
);
}
$smarty->assign ( "foo", "bar" );
echo ( "yes" );
}
if ( 1 == 1 ) {
$smarty->assign ( "earth", "world" );
}
$smarty->assign ( "bob", "bob" );
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john@kegworks.com