Register

0)
{
$error = implode(“, “, $m).(count($m) > 1 ? ” fields are required.” : ” field is required.”);
}
else
{
$filepath = realpath(tempnam($_ENV[‘TMP’], “xlocatorlocation”));
$f = fopen($filepath, “w”);
fputcsv($f, array_keys($values), “,”);
fputcsv($f, array_values($values), “,”);
fclose($f);
$c = curl_init(“https://app.xtremelocator.com/siteAdmin/directImport.php”);
$xval = array(
“id” => “10826”,
“type” => “append”,
“file” => “@$filepath”
);
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_POSTFIELDS, $xval);
ob_start();
curl_exec($c);
$response = ob_get_contents();
ob_end_clean();

// send e-mail notification
$body = “New location registered:\n\n”;
foreach ($values as $k => $v)
{
if ($v != “” || in_array($k, $yesnoFields))
{
if (in_array($k, $yesnoFields))
{
$v = $v > 0 ? “Yes” : “No”;
}
if ($k == “SPECIALTIES”)
{
$vv = explode(“;”, $v);
foreach ($vv as $v)
{
$body .= “$v: Yes\n”;
}
}
else
{
$body .= “$k: $v\n”;
}
}
}
$email = “dave@kandpengineering.com”;
$from = $email;
mail(“$email”, “New location registered”, $body, “From: $from\nReply-To: $from”);
$message = “Registration Successful”;
}
}
?>

Registration Form
Number
Name*
Street
City
State
Zip
Country*
Phone
Toll Free
Fax
E-mail
Url
Contact Name
Contact Position
Highlight
Additional Info