Is there a problem doing this? For some reason in the below code, the notknown template displays variables from $trans.whatever but the known template does not. Driving me mad! lol
$transrow = $transresult->fetchRow(DB_FETCHMODE_ASSOC);
//if success then do the shit
if ($transrow['status']=="SUCCESS"){
//query to see if already a user
$email=$transrow['payer_email'];
$usersql="SELECT * FROM user WHERE email='$email'";
$userresult = $db->query($usersql);
if (DB::isError($userresult)) {
die ($userresult->getMessage());
}
$numrows = $userresult->numRows($userresult);
//if numrows is 0 user doesn't exist post will be to self and will have flag to insert
if ($numrows==0){
//show not exist template
$smarty->assign('trans', $transrow);
$mainframe="notknown.tpl";
}
//else is a user so post forwards to cycle
else {
//show exists template
$userrow = $userresult->fetchRow(DB_FETCHMODE_ASSOC);
//run cycle.php
$userid=$userrow['userid'];
$productid=$transrow['productid'];
$quantity=$transrow['quantity'];
include ('prodcycle.php');
$smarty->assign('trans', $transrow);
$mainframe="known.tpl";
$smarty->assign('user', $userrow);
}
}
Also $user.whatever does show ok in known.tpl it's very weird.
Any ideas?