JezK
Edit File: signup.php
<?php include('mainHeader.php'); $page = basename($_SERVER['PHP_SELF']); $countrycodes = $users->countries('dial_code',$recentPractCountry); if (isset($_POST['action']) && $_POST['action'] == 'adduser') { $showmsg = ''; $existemail = $users->getUsers('email', $_POST['email']); if (is_array($existemail) && count($existemail) > 0) { $showmsg = 'Given email already existed'; } else { /////////Mobie Number Existed Or Not///// $existmobile = $users->getUsers('mobile', $_POST['mobile']); if (is_array($existmobile) && count($existmobile) > 0) { $showmsg = 'Given mobile already existed'; } else { $existmobile = $users->getUsers('username', $_POST['username']); if (is_array($existmobile) && count($existmobile) > 0) { $showmsg = 'Given username already existed username'; } } } if ($showmsg !== '') { echo "<script>alert('" . $showmsg . "');</script>"; } else { $adduser = $users->addusers($_POST); $userID = $users->encrypt_decrypt('encrypt', $adduser); if ($adduser == 0) { $showmsg = 'User account creation failed'; echo "<script>alert('" . $showmsg . "');</script>"; } if ($adduser == -5) { $showmsg = 'Profile Picture Upload Failed'; echo "<script>alert('" . $showmsg . "');</script>"; } else { // echo "<script>alert('User account created successfully');window.location='login.php';</script>"; echo "<script>window.location='verifyMobile.php?uid=" . $userID . "';</script>"; } } } ?> <section class="mt-5 pt-4 loginUser-margin top-margin"> <div class="container-fluid bg-white text-dark border"> <div class="row p-4"> <div class="col-sm-4 col-md-5 col-lg-4 col-xl-3 side-border"> <img src="img/illustration1.png" width="250px" height="250px"> </div> <div class="col-sm-8 col-md-7 col-lg-8 col-xl-9"> <ul class="nav nav-tabs border-0"> <li class="nav-item"> <a class="nav-link anc-Colorcurrent <?php if ($page == 'login.php') { echo 'active'; } else { echo ''; } ?>" href="login.php">Login</a> </li> <li class="nav-item"> <a class="nav-link anc-Colorcurrent <?php if ($page == 'signup.php') { echo 'active'; } else { echo ''; } ?>" href="signup.php">Sign up</a> </li> </ul> <div class="row mt-4"> <h6 class="col-xl-6">JOIN VIDEO CONFERENCE</h6> <!-- <p class="col-xl-6 justify-content-end d-flex">Are you a Professional? <a href="" class='register-here'>REGISTER HERE</a></p> --> </div> <form method="post" name="adduser" id="adduser" action="" onsubmit="return addUserValidation();" enctype="multipart/form-data"> <div class="row "> <div class="col-8 col-sm-8 mb-4 col-xl-8 report-m"> <div class="row"> <div class="col-12 col-sm-4 col-xl-2"> <img id="profileImage" class="rounded-circle " width="80px" height="80px"src="img/avatar-7.jpg" alt="your image" class="uploadImg"> </div> <div class="col-12 col-sm-4 col-xl-8 mt-2"> <div class=""></div> <div class="mt-3"> <label for="profilePicture" class=" browsePic-user"><img src="img/browsephoto.png">Browse Photo</label> <input type="file" id="profilePicture" name="profilePicture" class="d-none" accept="image/jpg,image/jpeg, image/png" > <!-- <button class="mt-1 photo-up"><img src="img/takeaphoto.png"> Take a photo</button> --> </div> </div> </div> </div> <div class="col-4 col-sm-4 col-xl-4 mt-4"> <!-- <div class=""><a href="#" class="btn btn-primary w-100">Save Changes</a></div> --> </div> </div> <hr class="new2"> <div class="row"> <div class="form-group col-12 col-sm-6 col-md-6"> <label for="fullname" class="fieldName">Full Name</label> <input type="text" class="form-control formField-control" name="fullname" id="fullname" value="<?php echo isset($_POST['fullname']) ? $_POST['fullname'] : ''; ?>"> </div> <div class="form-group col-12 col-sm-6 col-md-6"> <label for="mobile" class="fieldName">Mobile Number</label> <select name="country_code" id="country_code" class="countryCode filterby"> <?php foreach ($countrycodes as $k => $v) { $selectedval = ''; if (isset($_POST['country_code']) && $_POST['country_code'] != '' && $_POST['country_code'] == str_replace('+', '', $v['dial_code'])) { $selectedval = "selected"; } echo "<option value='" . str_replace('+', '', $v['dial_code']) . "' " . $selectedval . ">" . $v['dial_code'] . "</option>"; } ?> </select> <input type="tel" class="form-control formField-control w-100 mobilenoLeftalign" name="mobile" id="mobile" maxlength="15" autocomplete="off" autofocus value="<?php echo isset($_POST['mobile']) ? $_POST['mobile'] : ''; ?>" /> </div> </div> <div class="row"> <div class="form-group col-12 col-sm-6 col-md-6"> <label for="email" class="fieldName">Email</label> <input type="text" class="form-control formField-control" name="email" id="email" value="<?php echo isset($_POST['email']) ? $_POST['email'] : ''; ?>"> </div> <div class="form-group col-12 col-sm-6 col-md-6"> <label for="location" class="fieldName">Location</label> <input type="text" class="form-control formField-control" name="location" id="location" value="<?php echo isset($_POST['location']) ? $_POST['location'] : ''; ?>"> </div> </div> <div class="row"> <div class="form-group col-12 col-sm-6 col-md-6"> <label for="username" class="fieldName">Username</label> <input type="text" class="form-control formField-control" name="username" id="username" value="<?php echo isset($_POST['username']) ? $_POST['username'] : ''; ?>"> </div> <div class="form-group col-12 col-sm-6 col-md-6"> <label for="password" class="fieldName">Password</label> <div> <input type="password" class="form-control formField-control pwd" name="password" id="password" value="<?php echo isset($_POST['password']) ? $_POST['password'] : ''; ?>" onkeypress="return checkSpace(event)" onpaste="return false"> <span toggle="#password" class="showHide field-icon toggle-password fieldName-forgot" id="show">Show</span> </div> </div> </div> <div class="row"> <div class="form-group col-12 col-sm-6 col-md-6"> <input type="checkbox" id="promotional" name="promotional" value="1" <?php echo isset($_POST['promotional']) ? 'checked' : ''; ?>> <label for="promotional" class="fieldName">Receive relavent offers and promotional communications from us</label> </div> </div> <div class="row"> <div class="form-group col-12 col-sm-6 col-md-6"> <input type="checkbox" id="agree" name="agree" value="1" <?php echo isset($_POST['agree']) ? 'checked' : ''; ?>> <label for="agree" class="fieldName pt-1">I agree to <span class="fieldName-forgot">Terms</span> & <span class="fieldName-forgot">Privacy policy</span></label> </div> <input type="hidden" name="action" value="adduser"> <div class="form-group col-12 col-sm-6 col-md-6 "> <label></label> <input type="submit" value="Register" class="btn basic-btn-color w-100"> </div> </div> <!-- <div class="row"> <div class="col-sm-8 col-md-8 col-lg-6 col-xl-6"> <div class="form-group"> <label for="fullname" class="fieldName">Full Name</label> <input type="text" class="form-control formField-control" name="fullname" id="fullname" value="<?php echo isset($_POST['fullname']) ? $_POST['fullname'] : ''; ?>"> </div> <div class="form-group"> <label for="email" class="fieldName">Email</label> <input type="text" class="form-control formField-control" name="email" id="email" value="<?php echo isset($_POST['email']) ? $_POST['email'] : ''; ?>"> </div> <div class="form-group"> <label for="username" class="fieldName">Username</label> <input type="text" class="form-control formField-control" name="username" id="username" value="<?php echo isset($_POST['username']) ? $_POST['username'] : ''; ?>"> </div> <div class="form-group "> <input type="checkbox" id="promotional" name="promotional" value="1" <?php echo isset($_POST['promotional']) ? 'checked' : ''; ?>> <label for="promotional" class="fieldName">Receive relavent offers and promotional communications from us</label> </div> <div class="form-group"> <input type="checkbox" id="agree" name="agree" value="1" <?php echo isset($_POST['agree']) ? 'checked' : ''; ?>> <label for="agree" class="fieldName pt-1">I agree to <span class="fieldName-forgot">Terms</span> & <span class="fieldName-forgot">Privacy policy</span></label> </div> </div> <div class="col-sm-8 col-md-8 col-lg-6 col-xl-6"> <div class="form-group"> <label for="mobile" class="fieldName">Mobile Number</label> <select name="country_code" id="country_code" class="countryCode filterby"> <?php foreach ($countrycodes as $k => $v) { $selectedval = ''; if (isset($_POST['country_code']) && $_POST['country_code'] != '' && $_POST['country_code'] == str_replace('+', '', $v['dial_code'])) { $selectedval = "selected"; } echo "<option value='" . str_replace('+', '', $v['dial_code']) . "' " . $selectedval . ">" . $v['dial_code'] . "</option>"; } ?> </select> <input type="tel" class="form-control formField-control w-100 mobilenoLeftalign" name="mobile" id="mobile" maxlength="15" autocomplete="off" autofocus value="<?php echo isset($_POST['mobile']) ? $_POST['mobile'] : ''; ?>" /> </div> <div class="form-group"> <label for="location" class="fieldName">Location</label> <input type="text" class="form-control formField-control" name="location" id="location" value="<?php echo isset($_POST['location']) ? $_POST['location'] : ''; ?>"> </div> <div class="form-group"> <label for="password" class="fieldName">Password</label> <div> <input type="password" class="form-control formField-control pwd" name="password" id="password" value="<?php echo isset($_POST['password']) ? $_POST['password'] : ''; ?>" onkeypress="return checkSpace(event)" onpaste="return false"> <span toggle="#password" class="showHide field-icon toggle-password fieldName-forgot" id="show">Show</span> </div> <input type="hidden" name="action" value="adduser"> <div class="form-group mt-4 pt-1"> <label></label> <input type="submit" value="Register" class="btn basic-btn-color w-100"> </div> </div> </div> </div> --> </form> </div> </div> </div> </div> </section> <?php include('mainFooter.php') ?> <script> $("#profilePicture").change(function() { readURL(this, 'profileImage'); }); $("#backgroundPicture").change(function() { readURL(this, 'backgroundImage'); }); function checkSpace(e) { var key = e.keyCode if (key == 32) { alert("Space is not allowed in the password"); return false; } return true; } $(".toggle-password").click(function() { $(this).toggleClass("showHide"); var input = $($(this).attr("toggle")); if (input.attr("type") == "password") { input.attr("type", "text"); document.getElementById("show").innerHTML = "Hide"; } else { input.attr("type", "password"); document.getElementById("show").innerHTML = "Show"; } }); </script>