Hi zabmilenko, sorry I misunderstood.
Below is the code I am working with:
We have a form and inthe form there is the following line:
<input type="text" readonly="readonly" class="agentformbl" name="couponid" value="{foreach from=$coupons item=c}{$c.code}
{/foreach}" size="32" />
I then need to extract the content of "{foreach from=$coupons item=c}{$c.code}
{/foreach}" example "DA7206F346" each time the script is run the data will be different, its randomly generated.
I then need to assign the "DA7206F346" to a $_SEESION var, and this is where I am having problems.
The FORM is called from a script, here is the relative section:
function display_generate_form(){
global $db, $t, $vars;
global $start, $count, $all_count;
$t->assign('discount_types', array('%' => '%'));
$products = array("26");
$products[ $p['product_id'] ] = $p['title'];
$t->assign('products', $products);
$t->assign('action', 'generate');
$t->assign('vars', $vars);
$t->display('coupon_gen_tier.html');
}
function generate_coupons(){
global $db, $t, $vars;
$vars['discount'] = trim("$vars[discount_v] $vars[discount_t]");
set_date_from_smarty('begin_date', $vars);
set_date_from_smarty('expire_date', $vars);
$batch_id = $db->generate_coupons($vars);
$coupons = $db->get_coupons('batch_id', $batch_id);
$t->assign('coupons', $coupons);
$t->display('coupon_generated_tier.php');
}
This script display the script with the FORM on it.
So what I need to end up with is $_SESSION['foo'] = the content of {foreach from=$coupons item=c}{$c.code}{/foreach}
I hope this makes sense.