http_build_query

$params = array(
  'id' => $formID, 
  'key' => $formKey, 
  'type' => 1
);

$protocol = 'http';
if($_SERVER['HTTPS'] == 'on') $protocol = 'https';
$url = $protocol . '://' . $_SERVER["SERVER_NAME"] . '/form/?' . http_build_query($params);
//echo $url;
//exit();