client_url=".$client_url; /*$svCheck=explode("www.", $_SERVER["SERVER_NAME"]); if(empty($svCheck[1])) $_SERVER["SERVER_NAME"]="www.".$_SERVER["SERVER_NAME"]; //*********************************************************** //@ regular epression: ^ = starts with, then stuff between () is the total expression that can reoccur 3 times {3} //@ [0-9]{2,3}\. is the numbers between the . can be composed of 2 to 3 numbers if(ereg("([0-9]{2,3}\.){3}[0-9]{2,3}",$client_url)) { // we are local on VM define ("HOSTNAME","192.168.13.240"); define ("DATABASE","webpro_integration"); define("USERNAME","root"); define ("PASSWORD","letmein"); $client_url ="http://192.168.13.240/webPro/www_int/"; $client_url_host ="http://192.168.13.240/webPro/www_int/"; } else { define ("HOSTNAME","localhost"); define ("DATABASE","web_pro_it"); define ("USERNAME","root"); define ("PASSWORD","Jac%kEl10"); $client_url_final ="https://www.webprosecure.co.uk/applicationFrame/factfind/"; $client_url_host =$client_url; $client_url =""; }*/ $svCheck=explode(".",$client_url); $client_url_host = $client_url; if(count($svCheck) ==1) // devserver { if($client_url =="webprosecure") { $client_url ="webpro-it"; } $client_url = "www.".$client_url.".co.uk"; $client_url_final="http://webprosecure/applicationFrame/factfind/"; } else { $client_url_final ="https://www.webprosecure.co.uk/applicationFrame/factfind/"; } include_once('../dbConfig.php'); //define ("HOSTNAME","localhost"); //define ("DATABASE","web_pro_it"); //define ("USERNAME","root"); //define ("PASSWORD","Jac%kEl10"); require_once("../classes/dbConnection.class.php"); $db =new Connection(); //***************************************** // CALCULATOR REDIRECT if(isset($_REQUEST['type'])) { switch($_REQUEST['type']) { case "calculators": calculators($db); break; case "enquiryforms": enquiryForms($db); break; case "compare": compare($db); break; case "online": online($db); break; } } else { clientLogin($db ); } function calculators($db) { global $client_url; (isset($_REQUEST['tag']))? $tagType = $_REQUEST['tag']: $tagType=""; // get page url $db->execute("SELECT cms_options.*, cms_optionContent.*, cms_content.*, cms_c_page.c_page_content FROM cms_options, cms_optionContent, cms_content, cms_c_page WHERE cms_c_page.c_page_content ='boltons/extraFacilities/facilitiesCalculators.php' AND cms_c_page.id_c_page=cms_content.content_text AND cms_options.id_option=cms_optionContent.id_option AND cms_optionContent.id_content=cms_content.id_content "); $row = $db->fetchArray(); $redirect = $client_url."/index.php?p=".$row['id_option']."&tag=".$tagType; header("location: http://".$redirect); } function enquiryForms($db) { global $client_url; (isset($_REQUEST['tag']))? $tagType = $_REQUEST['tag']: $tagType=""; // get page url $db->execute("SELECT cms_options.*, cms_optionContent.*, cms_content.*, cms_c_page.c_page_content FROM cms_options, cms_optionContent, cms_content, cms_c_page WHERE cms_c_page.c_page_content ='boltons/extraFacilities/facilitiesEnquiryForms.php' AND cms_c_page.id_c_page=cms_content.content_text AND cms_options.id_option=cms_optionContent.id_option AND cms_optionContent.id_content=cms_content.id_content "); $row = $db->fetchArray(); $redirect = $client_url."/index.php?p=".$row['id_option']."&tag=".$tagType; header("location: http://".$redirect); } function compare($db) { global $client_url; //(isset($_REQUEST['tag']))? $tagType = $_REQUEST['tag']: $tagType=""; // get page url $db->execute("SELECT cms_options.*, cms_optionContent.*, cms_content.*, cms_c_page.c_page_content FROM cms_options, cms_optionContent, cms_content, cms_c_page WHERE cms_c_page.c_page_content ='boltons/xmlFeeds/xmlFeedPage.php' AND cms_c_page.id_c_page=cms_content.content_text AND cms_options.id_option=cms_optionContent.id_option AND cms_optionContent.id_content=cms_content.id_content "); $row = $db->fetchArray(); $redirect = $client_url."/index.php?p=".$row['id_option']; //."&tag=".$tagType; header("location: http://".$redirect); } //@ RHIANNONE CHANGED THIS: it is used in the online services with the implementation of the Intermediary Page function online($db) { global $client_url; //(isset($_REQUEST['tag']))? $tagType = $_REQUEST['tag']: $tagType="";//@ Rhiannone commented this out //ONLINE SERVICES REDIRECT // $db->execute("SELECT cms_options.*, cms_optionContent.*, cms_content.*, cms_c_page.c_page_content FROM cms_options, cms_optionContent, cms_content, cms_c_page WHERE cms_c_page.c_page_content ='boltons/onlineServices/online.php' AND cms_c_page.id_c_page=cms_content.content_text AND cms_options.id_option=cms_optionContent.id_option AND cms_optionContent.id_content=cms_content.id_content "); $row = $db->fetchArray(); //$redirect = $client_url."/index.php?p=".$row['id_option']."&tag=".$tagType."&refer=".$_GET['refer']; $redirect = $client_url."/index.php?p=".$row['id_option']."&onlineservicenum=".$_REQUEST['onlineservicenum']."&refer=".$_GET['refer'];//@ Rhiannone's new link header("location: http://".$redirect);//@ Rhiannone included http:// at the begining otherwise $redirect has entire path $redirect added at the end of the path to this file } function clientLogin($db) { global $client_url; global $client_url_final; global $client_url_host; //CLIENT LOGIN REDIRECT // // Choosing right template for the client using donain $db->execute("SELECT cms_client.ses_cmsClient FROM cms_client WHERE cms_client.client_url='".$client_url."' AND cms_client.client_status='1'"); $clientRow=$db->fetchArray(); $clientNum = $db->numberOfRows(); if($clientNum ==0) { $redirect = $client_url_host; } else { $redirect = $client_url_final."index.php?cmi=".$clientRow['ses_cmsClient']; } //echo $redirect; header("location: ".$redirect); } ?>