LAST) return ORDER; if (CHALLENGE !== FALSE && $page > CHALLENGE && empty($_SESSION['interbook'])) return 'challenge.html?page=' . $next; return $_SERVER['PHP_SELF'] . '?page=' . $next; } // Page Layout $page = isset($_REQUEST['page']) && $_REQUEST['page'] >= 1 ? $_REQUEST['page'] : 1; if (! empty($_POST['page'])) $page += STARTAT - 1; $next = $page < LAST ? $page + 1 : 1; $previous = $page > 2 ? $page - 1 : 1; if (isset($blank[$page])) header('Location: index.html?page=' . $next); if (CHALLENGE !== FALSE && $page > CHALLENGE && empty($_SESSION['interbook'])) header('Location: challenge.html?page=' . $page); $security = array('read' => TRUE, 'add' => TRUE, 'update' => TRUE, 'delete' => FALSE); $table = array('name' => 'interbookcomments', 'sort' => 'createstamp', 'direction' => 'DESC', 'primary' => 'commentid'); $form = array('name' => 'index', 'navigation' => FALSE, 'custom' => TRUE, 'fields' => array('linktable', 'linkid', 'name', 'email', 'website', 'comment'), 'required' => array(TRUE, TRUE, TRUE, TRUE, FALSE, TRUE), 'error' => array('hardcode', 'hardcode', 'any', 'email', 'any', 'any'), 'data' => array('interbookcomments', $page, '', '', '', '')); include(LAYOUTPATH . 'interbook.top.layout.php'); if ($_GET['go'] == 4) $_SESSION['interbook'] = TRUE; if (clickButton('post')) { if (errorCheck($form['fields'], $form['required'], $form['error'], $form['data'])) { form($form, $table, $security, $page); } else { if ($commentid = submit($form, $table, $security, '', FALSE)) form($form, $table, $security, $page); } } elseif (! empty($_SESSION['interbook'])) { form($form, $table, $security, $page); } else { form($form, $table, $security, $page); } include(LAYOUTPATH . 'interbook.bottom.layout.php'); ?>