我正在创建一个航班/酒店预订系统,例如 farecompare.com Farecompare 将值解析到其他站点并创建会话其他站点。任何人都告诉我他们如何在其中创建会话。我可以解析 url,但我无法创建会话。
public function flight($depart, $return, $from, $to, $type, $class,
$adults, $seniors, $children) {
$dep = explode("/", $depart);
$ret = explode("/", $return);
if ($type == 'RoundTrip') {
$expurl = 'http://www.expedia.co.in/Flights-Search?trip=' .
strtolower($type) . '&leg1=from%3A' . $from .
'%29%2Cto%3A' . $to .
'%29%2Cdeparture%3A' . $dep[1] .
'/'.$dep[0].'/'.$dep[2].
'TANYT&leg2=from%3A' . $to .
'%29%2Cto%3A' . $from .
'%29%2Cdeparture%3A' .
$ret[1].'/'.$ret[0].'/'.$ret[2] .
'TANYT&passengers=children%3A' . $children .
'%2Cadults%3A' . $adults .
'%2Cseniors%3A' . $seniors .
'%2Cinfantinlap%3AY&options=cabinclass%3Aeconomy'.
'%2Cnopenalty%3AN%2Csortby%3Aprice&mode=search';
echo '<a href = "' . $expurl . '" target = "_blank">Expedia</a>';
} else {
$type = 'oneway';
$expurl = 'http://www.expedia.co.in/Flights-Search?trip='.
strtolower($type) . '&leg1=from%3A' . $from .
'%29%2Cto%3A' . $to . '%29%2Cdeparture%3A' .
$dep[1].'/'.$dep[0].'/'.$dep[2] .
'TANYT&passengers=children%3A' . $children .
'%2Cadults%3A' . $adults .
'%2Cseniors%3A' . $seniors .
'%2Cinfantinlap%3AY&options=cabinclass%3Aeconomy'.
'%2Cnopenalty%3AN%2Csortby%3Aprice&mode=search';
echo '<a href = "' . $expurl . '" target = "_blank">Expedia</a>';
}
}
我在 Expedia 上工作,通过解析 url 来获取数据,但还有其他网站,如cheapoit、travelocity 等使用会话。如何创建会话?