Thursday, 26 September 2013

URL parsing and sessions in Reservation system

URL parsing and sessions in Reservation system

I am creating a flight/hotel reservation system like farecompare.com
Farecompare parse values to other sites and create sessions other sites
too. Anyone tell me how they create sesssions in it. I can parse url but i
am not able to create sessions.
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>';
}
}
I worked on Expedia by parsing url to get data but there are other sites
like cheapoait, travelocity etc which uses sessions. How to create
sessions

No comments:

Post a Comment