[insert_php] // construct our string URL to call the iFrame $siteid=’WALNUT1353′; // Hotel site ID $server=’uk1′; // Roomlynx Server Prefix /* The following are valid parameters for the OBM iFrame construction. For safety, we will only ‘get’ what is valid… We also protect ourselves from errors by issuing defaults for some of the variables We also need to ensure that any forms/widgets are using fields in the ‘clientmap’ section (need to be settings options) These $clientmap examples are from Guestline Hotel’s widget: They map custom variables into ones expected by the iFrame The $obmfield array is the common set of variables which can be used. Where the key doesn’t reference ‘false’ you can place ‘default’ values in to the array to override should no value be provided */ $clientmap=array(); $obmfields=array( ‘arrival’=>date(‘d/m/Y’,time()+(60*60*24)), ‘departure’=>false, ‘numberOfNights’=>2, ‘numberOfPersons’=>2, ‘numberOfChildren’=>0, ‘numberOfInfants’=>false, ‘request_locale’=>’en’, ‘roomCategory’=>false, ‘rateCategory’=>false, ‘offerCode’=>false, ‘selectSpecialOfferId’=>false ); /// loop through, create variable pairs… /// grab the query string parse_str($_SERVER[‘QUERY_STRING’],$inputvar); /// re-map $newinputvar=array(); foreach($inputvar as $in=>$val) { if(isset($clientmap[$in])) { $newinputvar[$clientmap[$in]]=$val; } else { $newinputvar[$in]=$val; } } $inputvar=$newinputvar; /// lowercase them $inputvar=array_change_key_case($inputvar,CASE_LOWER); /// loop through $urlvars=array(); foreach($obmfields as $k=>$v) { $getvar=false; if(isset($inputvar[strtolower($k)])) { $urlvars[$k]=$inputvar[strtolower($k)]; } elseif($v!=false) { $urlvars[$k]=$v; } } $url=”https://$server.roomlynx.net/rezrooms2/loadOBMApplication.action?siteId=$siteid&chainAction=newAvailabilitySearch&”.http_build_query($urlvars); [/insert_php]