<?php
$cookie_file = dirname(__FILE__) . "/cookie.txt";
if(!file_exists($cookie_file)) {
	$f = fopen($cookie_file, "w");
	fclose($f);
}


$qs = "";
foreach ($_GET as $fld=>$val) {
	$qs .= rawurlencode($fld) . '=' . urlencode($val) . '&';
}
$qs = rtrim($qs, '&');


$url = 'https://www.booking.com/searchresults.html' . '?' . $qs;


$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);

$page_init = curl_exec($ch);
curl_close($ch);

echo $page_init;
?>