Skip to content

Instantly share code, notes, and snippets.

@joshuabaker
Created July 21, 2014 14:14
Show Gist options
  • Save joshuabaker/a541045167c96ad51146 to your computer and use it in GitHub Desktop.
Save joshuabaker/a541045167c96ad51146 to your computer and use it in GitHub Desktop.
Referral helper for OpenTable form submissions
<?php
/**
* Referral helper for OpenTable form submissions
*
* The RestaurantReferralID must match the RestaurantID value, however the
* only solution for this is JavaScript. This script copies the
* RestaurantID into the RestaurantReferralID and passes it to the
* OpenTable action endpoint.
*
* @author Made by Cloud Limited
*/
$request = $_REQUEST;
if (isset($request['RestaurantReferralID'])
&& isset($request['RestaurantID'])
&& (empty($request['RestaurantReferralID'])
|| $request['RestaurantReferralID'] != $request['RestaurantID']))
{
$request['RestaurantReferralID'] = $request['RestaurantID'];
}
header('Location: http://www.opentable.co.uk/restaurant-search.aspx?' . http_build_query($request));
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment