index.phpI moved the 'Deadline' and 'Number Required Pages' from elements from custom.php to index.php. This required that I turn the mainpage(index.php) into a from . This is accomplished by
if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
$process = true;
$deadline = tep_db_prepare_input($HTTP_POST_VARS['deadline']);
$req_pages = tep_db_prepare_input($HTTP_POST_VARS['req_pages']);
$error = false;
if (strlen($deadline) < error =" true;">add('index', ENTRY_DEADLINE_ERROR);
}
if (strlen($req_pages) < error =" true;">add('index', ENTRY_REQ_PAGES_ERROR);
}
if ($error == false) {
if (SESSION_RECREATE == 'True'){
tep_session_recreate();
}
//restore cart contents
$cart->restore_contents();
//HR: redirecting to appropriate product
(int)$dead_day= substr($deadline, -2);
if($dead_day<0) $dead_day=-($dead_day); (int)$today=date("d"); $dead_day++; $days=$dead_day-$today; $product_id_query=tep_db_query("select id from custom_products where days =" . $days . " and pages = " . $req_pages ); $product_id_array=tep_db_fetch_array($product_id_query); $product_id=$product_id_array['id']; tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_id)); }
...
HTML
...
echo tep_draw_form('custom_order', tep_href_link(FILENAME_DEFAULT, '', 'SSL'), 'post', '') . tep_draw_hidden_field('action', 'process'); ?>
...
Form