function href_link($page = '', $parameters = '', $connection = 'NONSSL') { global $link; if ($page == '') { die('</td></tr></table></td></tr></table><br /><br /><font color="#ff0000"><b>Error!</b></font><br /><br /><b>Unable to determine the page link!<br /><br />'); } if ($connection == 'NONSSL') { $link = HTTP_SERVER . DIR_WS_SCRIPTS; } elseif ($connection == 'SSL') { if (ENABLE_SSL == 1) { $link = HTTPS_SERVER . DIR_WS_SCRIPTS; } else { $link = HTTP_SERVER . DIR_WS_SCRIPTS; } } else { die('</td></tr></table></td></tr></table><br /><br /><font color="#ff0000"><b>Error!</b></font><br /><br /><b>Unable to determine connection method on a link!<br /><br />Known methods: NONSSL SSL</b><br /><br />'); } // Put the session in the URL if we are we are using cookies and changing to SSL // Otherwise, we loose the cookie and our session if (!SID && !getenv(HTTPS) && $connection == 'SSL') { $sess = wrap_session_name() . '=' . wrap_session_id(); } else { $sess = SID; } if ($parameters == '') { $link = $link . $page . '?' . $sess; } else { $link = $link . $page . '?' . $parameters . '&' . $sess; } while (substr($link, -1) == '&' || substr($link, -1) == '?') { $link = substr($link, 0, -1); } return $link; }
// make a connection to the database... now wrap_db_connect() or die('Unable to connect to database server! A working MySQL database is needed. ' . 'Please see includes/application_top.php to configure your MySQL database connection parameters. ' . 'See sql/mysql.sql for MySQL that needs to be executed to setup the database tables for the booking calendar.'); // SESSION INI CHANGES // Change the session name for security purposes. ini_set("session.name", "SID"); // Do not pass the session id thru the URL, use cookies only. ini_set("session.use_trans_sid", 0); // Change the session save path because we could be on a shared server. ini_set("session.save_path", DIR_FS_SESSIONS); // Use only cookies for session management. ini_set("session.use_only_cookies", 1); // define how the session functions will be used include_once DIR_WS_FUNCTIONS . 'sessions.php'; // lets start our session if (@(!SID) && $_REQUEST[wrap_session_name()]) { wrap_session_id($_REQUEST[wrap_session_name()]); } wrap_session_start(); if (function_exists('session_set_cookie_params')) { session_set_cookie_params(0, DIR_WS_SCRIPTS); } // define our general functions used application-wide include_once DIR_FS_FUNCTIONS . 'booking_db_fns.php'; include_once DIR_FS_FUNCTIONS . 'calendar_fns.php'; include_once DIR_FS_FUNCTIONS . 'common_fns.php'; include_once DIR_FS_FUNCTIONS . 'general.php'; include_once DIR_FS_FUNCTIONS . 'validations.php'; // Include the user and password crypto functions include_once DIR_FS_FUNCTIONS . 'user_auth_fns.php'; include_once DIR_FS_FUNCTIONS . 'password_funcs.php'; // Set the Error Reporting to show critical errors or warnings.