/home/u775757334/domains/civicwelllife.com/public_html/admin/function
Edit: /home/u775757334/domains/civicwelllife.com/public_html/admin/function/main_function.php (3656B)
0){
echo "This email id already register.";
}else{
$sql="insert into tbl_user(name,email,phone,mode,password,date) values('$name','$email','$phone','$mode','$password','$date')";
if(mysqli_query($conn,$sql) or die(mysql_error($conn)))
{
echo "1";
}
else
{
echo "Try Again";
}
}
}
function memberRegistration($conn)
{
$name = html2text(mysqli_real_escape_string($conn,$_POST['txtname']));
$email = html2text(mysqli_real_escape_string($conn,$_POST['txtemail']));
$phone = html2text(mysqli_real_escape_string($conn,$_POST['txtphone']));
$mode = $_POST['txtmode'];
$password = md5($_POST['txtpassword']);
$date = date("Y-m-d");
$memberpin = $_POST['txtmemberpin'];
$flag=0;
$sqlc=mysqli_query($conn, "select * from tbl_user where email='$email'") or die(mysqli_query($conn));
if(mysqli_num_rows($sqlc)>0){
$flag=1;
}
if($flag==0){
$sqlc=mysqli_query($conn, "select * from tbl_token where name='$memberpin'") or die(mysqli_query($conn));
if(mysqli_num_rows($sqlc)>0){
}else{
$flag=2;
}
}
if($flag==0){
$sqlc=mysqli_query($conn, "select * from tbl_user where member_token='$memberpin'") or die(mysqli_query($conn));
if(mysqli_num_rows($sqlc)>0){
$flag=3;
}
}
if($flag==1){
echo "This email id already register.";
}else if($flag==2){
echo "Please enter the vaild pin.";
}else if($flag==3){
echo "This Pin Number already used.";
}else{
$sql="insert into tbl_user(name,email,phone,mode,password,date,member_token) values('$name','$email','$phone','$mode','$password','$date','$memberpin')";
if(mysqli_query($conn,$sql) or die(mysql_error($conn)))
{
echo "1";
}
else
{
echo "Try Again";
}
}
}
function userLogin($conn){
$email = html2text(mysqli_real_escape_string($conn,$_POST['txtemail']));
$password = md5($_POST['txtpassword']);
$sqlc=mysqli_query($conn,"select * from tbl_user where email='$email' and password='$password'") or die(mysqli_error($conn));
if(mysqli_num_rows($sqlc)>0){
$rows = mysqli_fetch_assoc($sqlc);
$_SESSION['user']=$email;
$_SESSION['mode']=$rows['mode'];
$_SESSION['mode']=$rows['name'];
echo "1";
}else{
echo "Email ID and Password does not matched.";
}
}
?>