<?php
// Include confi.php
include_once('../confi.php');
//$apikey = "123456789";
//if ($_GET['apikey'] == $apikey) {
if($_SERVER['REQUEST_METHOD'] == "POST"){
// Get data
$fname = isset($_POST['fname']) ? mysql_real_escape_string($_POST['fname']) : "";
$lname = isset($_POST['lname']) ? mysql_real_escape_string($_POST['lname']) : "";
$email= isset($_POST['email']) ? mysql_real_escape_string($_POST['email']) : "";
$mobile_number = isset($_POST['mobile_number']) ? mysql_real_escape_string($_POST['mobile_number']) : "";
$house_number= isset($_POST['house_number']) ? mysql_real_escape_string($_POST['house_number']) : "";
$pass= isset($_POST['pass']) ? mysql_real_escape_string($_POST['pass']) : "";
$r_city= isset($_POST['r_city']) ? mysql_real_escape_string($_POST['r_city']) : "";
$r_socitey= isset($_POST['r_socitey']) ? mysql_real_escape_string($_POST['r_socitey']) : "";
// Insert data into data base
//$sql = "INSERT INTO `sub_category` (`subcat_id`,`sub_name`,`sub_description`,`category_id`) VALUES (NULL,'$subcat_name','$sub_description','$catgory_id');";
$sql = "insert into register(r_id,fname,lname,email,mobile_number,house_number,pass,r_city,r_socitey) VALUES (NULL,'$fname','$lname','$email','$mobile_number','$house_number','$pass','$r_city',$r_socitey)";
$qur = mysql_query($sql);
$result =array();
if($qur){
$result[] = array("msg" => "Your Registration Has Completed Successfully","r_id" => mysql_insert_id(),"fname" => $fname,"lname" => $lname,"email" => $email,"mobile_number" => $mobile_number,"house_number" => $house_number,"r_city" => $r_city,"r_socitey" => $r_socitey);
$json = array("status" => 1, "info" => $result);
}else{
$json = array("status" => 0, "msg" => "Error Registration Form ");
}
}else{
$json = array("status" => 0, "msg" => "Request method not accepted");
}
@mysql_close($conn);
/* Output header */
header('Content-type: application/json');
echo json_encode($json);
// Include confi.php
include_once('../confi.php');
//$apikey = "123456789";
//if ($_GET['apikey'] == $apikey) {
if($_SERVER['REQUEST_METHOD'] == "POST"){
// Get data
$fname = isset($_POST['fname']) ? mysql_real_escape_string($_POST['fname']) : "";
$lname = isset($_POST['lname']) ? mysql_real_escape_string($_POST['lname']) : "";
$email= isset($_POST['email']) ? mysql_real_escape_string($_POST['email']) : "";
$mobile_number = isset($_POST['mobile_number']) ? mysql_real_escape_string($_POST['mobile_number']) : "";
$house_number= isset($_POST['house_number']) ? mysql_real_escape_string($_POST['house_number']) : "";
$pass= isset($_POST['pass']) ? mysql_real_escape_string($_POST['pass']) : "";
$r_city= isset($_POST['r_city']) ? mysql_real_escape_string($_POST['r_city']) : "";
$r_socitey= isset($_POST['r_socitey']) ? mysql_real_escape_string($_POST['r_socitey']) : "";
// Insert data into data base
//$sql = "INSERT INTO `sub_category` (`subcat_id`,`sub_name`,`sub_description`,`category_id`) VALUES (NULL,'$subcat_name','$sub_description','$catgory_id');";
$sql = "insert into register(r_id,fname,lname,email,mobile_number,house_number,pass,r_city,r_socitey) VALUES (NULL,'$fname','$lname','$email','$mobile_number','$house_number','$pass','$r_city',$r_socitey)";
$qur = mysql_query($sql);
$result =array();
if($qur){
$result[] = array("msg" => "Your Registration Has Completed Successfully","r_id" => mysql_insert_id(),"fname" => $fname,"lname" => $lname,"email" => $email,"mobile_number" => $mobile_number,"house_number" => $house_number,"r_city" => $r_city,"r_socitey" => $r_socitey);
$json = array("status" => 1, "info" => $result);
}else{
$json = array("status" => 0, "msg" => "Error Registration Form ");
}
}else{
$json = array("status" => 0, "msg" => "Request method not accepted");
}
@mysql_close($conn);
/* Output header */
header('Content-type: application/json');
echo json_encode($json);
No comments:
Post a Comment