<?php
/*
#****************************************************************************#
# Ultimate Locator			                         	     #
# Professional Zip Code Locator Systems          support@ultimatelocator.com #
# Copyright 2004 PageSkills.com Internet Services    www.ultimatelocator.com #
# Release Date: 2/01/2004                                                    #
#                                                                            #
#   Ultimate Locator is protected by the copyright                           #
#   laws and international copyright treaties, as well as other              #
#   intellectual property laws and treaties.                                 #
#   Distribution without approved license is illegal and is                  #
#   punishable by law.                                                       #
#                                                                            #
#   A license is good toward one domain only.  You must purchase             #
#   additional licenses if you wish to install this software on              #
#   additional domains (websites). We do offer Reseller Packages.            #
#****************************************************************************#
*/

require_once("admin/config.php");
$fp=fopen("$user_path/visitor_add_complete.htm","r");
$str=fread($fp,filesize("$user_path/visitor_add_complete.htm"));

$query1="Select max(id) as id from location";
$data1 =mysql_query($query1,$zip_connection) or die(mysql_error());

$id = mysql_result($data1,0,"id");

$id=$id+1;

if($other!="")
{
$state=$other;
}

if($otherc!="")
{
$country=$otherc;
}

if(!isset($user1))
{
$user1="";
}

if(!isset($user2))
{
$user2="";
}

if(!isset($user3))
{
$user3="";
}

if(!isset($user4))
{
$user4="";
}
if(!isset($user5))
{
$user5="";
}

$pref1=1;
$hide=0;
$hits=0;

if($howadds==1)
{
$aprov=1;
}
else
{
$aprov=0;
}

$visitordate=date("Y-m-d");

if (empty($zip)) {
    $zip = $_POST['zip'];
}

foreach($_POST as $key => $val) {
    $$key = $_POST[$key];
}

$query = "Insert into  location(id,name,address1,address2,city,state,country,zip,telephone,fax,email,website,user1,user2,user3,user4,user5,pref,hide,hits,aprove,visitorname,visitoremail,visitordate, text_number) values('$id','$name','$address1','$address2','$city','$state','$country','$zip','$telephone','$fax','$email','$website','$user1','$user2','$user3','$user4','$user5','$pref1','$hide','$hits','$aprov','$visitorname','$visitoremail','$visitordate', '$text_number')";

$data =mysql_query($query,$zip_connection) or die(mysql_error());

echo $str;

?>

