require('../includes/application_top.php');
if(isset($_POST['submit'])){
$replace_str = array(" ", "&", "?");
$customers_id = fun_db_prepare_input($_POST['customers_id']);
$emailid = fun_db_prepare_input($_POST['emailid']);
$pwd = fun_db_prepare_input($_POST['pwd']);
$name = fun_db_prepare_input($_POST['name']);
$phone = fun_db_prepare_input($_POST['phone']);
$mobile = fun_db_prepare_input($_POST['mobile']);
$address = fun_db_prepare_input($_POST['address']);
$city = fun_db_prepare_input($_POST['city']);
$state = fun_db_prepare_input($_POST['state']);
if(!$state)
{
$state = fun_db_prepare_input($_POST['state_txt']);
}
$country = fun_db_prepare_input($_POST['country']);
$business_name = fun_db_prepare_input($_POST['business_name']);
$pin = fun_db_prepare_input($_POST['pin']);
$website = fun_db_prepare_input($_POST['website']);
$status = fun_db_prepare_input($_POST['status']);
$ip_address=$_SERVER['REMOTE_ADDR'];
$curr_date = Date("Y-m-d H:i:s");
$login_status = $_POST['login_status'];
$old_login_status = $_POST['old_login_status'];
$featured = $_POST['featured'];
$curr_date = date("Y-m-d H:i:s");
/////////////////check email address//////////////////////
if($customers_id != '') {
$VSID = " AND customers_id != '$customers_id'";
}
$msg="";
$sql_select = "SELECT * FROM tbl_customers WHERE emailid ='".trim($emailid)."' $VSID";
$result_select = mysql_query($sql_select) or die(DB_QUERY_ERROR);
if(mysql_num_rows($result_select)!=0){
$msg = "Email id already exist. Please try another";
mysql_free_result($result_select);
}
if($msg=="")
{
$sql_insert_customers = "INSERT INTO tbl_customers(customers_id, emailid, pwd, name, phone, business_name, mobile, address, city, state, country, pin, website, status, email_val_key, ip_address) VALUES(null, '$emailid', '$pwd', '$name', '$phone','$business_name', '$mobile', '$address', '$city', '$state', '$country', '$pin','$website','0', '".RAND."', '$ip_address')";
mysql_query($sql_insert_customers) or die(DB_QUERY_ERROR.mysql_error());
$inserted_id=mysql_insert_id();
$activate_url="".$activate_registration_url."?val_key=".RAND." ";
////////////Admin Mail////////////////////////////
$filename="tmp_confirm_email.htm";
$fd = fopen( $filename, "r" );
$c_mail= fread( $fd, filesize( $filename ) );
$c_mail=str_replace( "[>CONFIRM_URL<]", $activate_url,$c_mail );
$c_mail=str_replace( "[>EMAILID<]", $emailid,$c_mail );
$c_mail=str_replace( "[>SITE_NAME<]", STORE_NAME,$c_mail );
$c_mail=str_replace( "[>SITE_URL<]", DIR_FS_CATALOG,$c_mail );
fclose( $fd );
$subject =EMAIL_SUBJECT_PREFIX ." Confirm your " . STORE_NAME . " registration";
send_mail($emailid, DONOT_REPLY_EMAIL_ADDRESS, '', '', $subject, $c_mail);
header("Location: ".DIR_FS_CATALOG."message.php?message=".urlencode("Registration Accepted A verification link has been sent to your email address. Please follow this link to complete your registration. If you do not receive the verification email, be sure to check your email spam settings and your spam or trash folders."));
exit;
}
}
if(empty($website))
{
$website='http://';
}
?>
Post a Free Classifed Ads in TITLE,
$sql_city="SELECT * FROM tbl_location_area where parent_id != 0 or name='Delhi & NCR' order by popular DESC, name";
$result_city = mysql_query($sql_city);
while($rows_city= mysql_fetch_array($result_city))
{
$city_name[] = $rows_city['name'];
$location_area_id[] = $rows_city['location_area_id'];
$popular[]=$rows_city['popular'];
}
if(is_array($city_name)){
$city_name=implode('" , "',$city_name);
}
if(is_array($popular)){
$popular=implode('" , "',$popular);
}
if(is_array($location_area_id)){
$location_area_id=implode('" , "',$location_area_id);
}
?>