<?php
/* Do not remove this line. Add your functions below. */
add_filter("gform_confirmation", "confirm_change", 10, 4);
function confirm_change($confirmation, $form, $lead, $ajax){
	
	global $my_transposh_plugin;
	
/* Only do this logic for form no. 4. */
	if($form["id"] == "4"){
		
	/* Build the url using valu from drop down fields and call the relevant url passing relevant tokens. */
    /* e.g: http://www.tozers.net/dev/onlythisnight/Book-a-night-in-London/?booking=Book-a-night-in-London&room=Double */
	/* $lead['1'] - has the value of field id: 1 selection.	*/
	/* $lead['2'] - has the value of field id: 2 selection.	*/	

/*    $url = get_bloginfo('url') . "/" . $lead['1'] . "?booking=" . ($lead['1']) . "&room=" . ($lead['2']);  */
    $url = get_bloginfo('url') . "/" . $lead['1'];

		
    $confirmation = array('redirect' => $url);
    return $confirmation;
	}
	
}


