<?php $mode = "R"; if (isset($_POST['tbname'])) { $name = isset($_POST['tbname']) ? $_POST['tbname'] : ""; $pwd = isset($_POST['tbpwd']) ? $_POST['tbpwd'] : ""; if (fnchkuser($name, $pwd, "") == true) { print "<script type='text/javascript' language='javascript'>window.location='index.php?id=alm&action=ok';</script>"; } else { print "<script type='text/javascript' language='javascript'>window.location='index.php?id=alg&action=notok';</script>"; } } function fnchkuser($uname, $upwd, $mde) { require "dbfl.php"; // $kcon = mysql_connect($hst, $nu, $dp) or die(mysql_error()); //$kcon=mysql_connect() or die(mysql_error()); if (!$kcon) { die('Could not connect. Try again later'); } mysql_select_db($dab, $kcon) or die(mysql_error()); $result = mysql_query("select lgid from lgm where lgname='" . $uname . "' and lgpd='" . $upwd . "'"); $row = mysql_fetch_array($result); if ($row['lgid'] > 0) { return true; } else { return false; } }
<?php $otpvrfd = false; $name = $_GET['mobn']; $rotp = $_GET['otpn']; $uid = fnchkuser($name, $rotp, ""); if ($uid > 0) { $otpvrfd = true; } else { $otpvrfd = false; } if ($otpvrfd) { $response["success"] = 1; $response["uid"] = $uid; echo json_encode($response); } else { $response["success"] = 0; $response["uid"] = -1; echo json_encode($response); } function fnchkuser($uname, $upwd, $mde) { require "dbfl.php"; // // echo $uname; // echo $upwd; $kcon = mysqli_connect($hst, $nu, $dp, $dab) or die(mysqli_error()); //$kcon=mysql_connect() or die(mysql_error()); if (!$kcon) { die('Could not connect. Try again later'); }
<!--</form>--> <?php } } elseif ($actn == "votp") { $otpsend = true; $name = isset($_POST['tbMobNo']) ? $_POST['tbMobNo'] : ""; $rotp = isset($_POST['tbpwd']) ? $_POST['tbpwd'] : ""; //echo "rotp".$rotp; // echo "name".$name; if ($rotp == "") { //echo $shwmsg = "Enter OTP received on your mobile."; $otpentd = false; } else { $otpentd = true; if (fnchkuser($name, $rotp, "") == true) { //echo "ok " .$src; if ($src == "1") { print "<script type='text/javascript' language='javascript'>window.location='index.php?id=myac&sc=" . $src . "&action=ok&st=1&tp=1';</script>"; } elseif ($src == "2") { print "<script type='text/javascript' language='javascript'>window.location='index.php?id=chk&sc=" . $src . "&action=ok';</script>"; } $otpvrfd = true; } else { ?> <!-- <div class="alert alert-danger" >Invalid OTP. Please try again.</div> <div class="form-group"> <label for="pwd">Enter OTP you recieved on Mobile:</label> <input type="hidden" class="form-control" name="tbMobNo" id="tbMobNo" value="<?php php; ?>