Server Admin

Viewing: reg.php

<?php  
include 'db.php';
if(isset($_POST['signup']))
{  

  $fname=$_POST['fullname'];
  $email=$_POST['emailid']; 
  $mobile=$_POST['mobileno'];
  $password=md5($_POST['password']);
  $token = md5(time().'-'.rand(0,9));
  $query = "INSERT into `users` (FullName,EmailId,MobileNumber,Password,token)
  VALUES ('$fname', '$email','$mobile','".md5($password)."','".$token."')";
  $result = mysqli_query($conn,$query);
  if($result)
  {
      $link="<a href='www.blissfintrip.com/verify.php?token=".$token."'>Click To Verify Email</a>";
   include'mailer/class.phpmailer.php';
   include'mailer/class.smtp.php';
    $mail = new PHPMailer();
    $mail->CharSet =  "utf-8";
    $mail->IsSMTP();
    // enable SMTP authentication
    $mail->SMTPAuth = true;                  
    // GMAIL username
    $mail->Username = "info@blissfintrip.com";
    // GMAIL password
    $mail->Password = "RK4HZ}C3L(?x";
    $mail->SMTPSecure = "ssl";  
    // sets GMAIL as the SMTP server
    $mail->Host = "mail.blissfintrip.com";
    // set the SMTP port for the GMAIL server
    $mail->Port = "465";
    $mail->From="info@blissfintrip.com";
    $mail->FromName='blissfintrip';
    $mail->AddAddress($email, $fname);
    $mail->Subject  =  'Verify Account';
    $mail->IsHTML(true);
    $mail->Body    = 'Click On This Link to Verify Account '.$link.'';
    if($mail->Send())
    {
      //echo "Check Your Email and Click on the link sent to verify email";
      echo "<script>alert('Check Your Email and Click on the link sent to verify email');</script>";
    }
    else
    {
      echo "Mail Error - >".$mail->ErrorInfo;
    }
      //session_start();
        //  $_SESSION['login']=$_POST['emailid'];
          //$_SESSION['fname']=$fname;
    //header("location:profile.php");
    
  }
  else 
  {
     
  echo "<script>alert('Something went wrong. Please try again');</script>";
  }
  }
  


?>
<script>
function checkAvailability() {
/*$("#loaderIcon").show();
jQuery.ajax({
url: "check_availability.php",
data:'emailid='+$("#emailid").val(),
type: "POST",
success:function(data){
$("#user-availability-status").html(data);
$("#loaderIcon").hide();
},
error:function (){}
}); */
}
</script>
 <link href="assets/css/login.css?v=1.1211" rel="stylesheet">
<div class="container-fluid ps-md-0">
  <div class="row g-0">
    <div class="d-none d-md-flex col-md-4 col-lg-6 bg-image"></div>
    <div class="col-md-8 col-lg-6">
      <div class="login d-flex align-items-center py-5">
        <div class="container">
          <div class="row">
            <div class="col-md-9 col-lg-8 mx-auto">
              <h3 class="login-heading mb-4">Start your journey with <b>blissfintrip</b></h3>

              <!-- Sign In Form -->
              <form method = "POST" action="<?=$_SERVER['PHP_SELF'];?>">
            <label style="font-size: 13px;">Sign up with your email address &amp; mobile :</label>
              <div class="form-floating mb-3">
                  <input type="text" class="form-control" id="floatingInput"name  = "fullname">
                  <label for="floatingInput">Full Name</label>
                </div>  
              
                <div class="form-floating mb-3">
                    <span class="m-pre-no">+91</span>
                <input type="text" class="form-control" name="mobileno" placeholder="Mobile Number" maxlength="10" required="required" style="padding-left:50px;">
                  <label for="floatingInput" style="left:40px;">Mobile Number</label>
                </div>  
              <div class="form-floating mb-3">
                  <input type="email" class="form-control" id="floatingInput" placeholder="name@example.com" name="emailid" id="emailid" onBlur="checkAvailability()" required="required">
                  <label for="floatingInput">Email address</label>
                </div>
                
                   <div class="form-floating mb-3">
                  <input type="password" class="form-control" id="floatingPassword" placeholder="Password" name  = "password" required="required">
                  <label for="floatingPassword">Password</label>
                </div>
                   <div class="form-floating mb-3">
                  <input type="text" class="form-control" id="floatingInput" placeholder="name@example.com" name="pincode" id="emailid" onBlur="checkAvailability()" required="required">
                  <label for="floatingInput">Pincode</label>
                </div>
             

               

                <div class="d-grid">
                  <button class="btn btn-lg btn-primary btn-login text-uppercase fw-bold mb-2" type="submit" name = "signup">Register</button>
                  <div class="text-center">
                    Already have an account?<a class="small" href="login.php" style="
    color: blue;
">Login</a>
                  </div>
                </div>

              </form>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<?php  include 'styles.php';      ?>
Back to File Manager