<?php
$con = oci_connect('test', 'tewst', 'ur address');
if (!$con) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}/* else {
print "Connected to Oracle!";
} */
//Getting the username and otp
$PHONE_NO = $_REQUEST['PHONE_NO'];
$otp = $_REQUEST['OTP'];
//Creating an SQL to fetch the otp from the table
$sql = oci_parse($con,"SELECT OTP FROM SE WHERE MOB_NO = '$PHONE_NO'");
$row=oci_execute($sql) or die(oci_error($sql));
$objResult = oci_fetch_array($sql);
//Getting the otp from the array
echo $realotp = $objResult['OTP'];
//If the otp given is equal to otp fetched from database
if($otp == $realotp){
//Creating an sql query to update the column verified to 1 for the specified user
$objParse = oci_parse($con,"UPDATE SE SET OTP_ACT = 1 WHERE MOB_NO ='$PHONE_NO'");
$objExecute = oci_execute($objParse, OCI_DEFAULT);
// Insert & commits
//$row1=oci_execute($sql1) or die(oci_error($sql1));
//If the table is updated
if($objExecute){
//displaying success
oci_commit($con); //*** Commit Transaction ***//
echo 'success';
}else{
//displaying failure
echo 'failure';
}
}else{
//displaying failure if otp given is not equal to the otp fetched from database
echo 'failure';
}
$con = oci_connect('test', 'tewst', 'ur address');
if (!$con) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}/* else {
print "Connected to Oracle!";
} */
//Getting the username and otp
$PHONE_NO = $_REQUEST['PHONE_NO'];
$otp = $_REQUEST['OTP'];
//Creating an SQL to fetch the otp from the table
$sql = oci_parse($con,"SELECT OTP FROM SE WHERE MOB_NO = '$PHONE_NO'");
$row=oci_execute($sql) or die(oci_error($sql));
$objResult = oci_fetch_array($sql);
//Getting the otp from the array
echo $realotp = $objResult['OTP'];
//If the otp given is equal to otp fetched from database
if($otp == $realotp){
//Creating an sql query to update the column verified to 1 for the specified user
$objParse = oci_parse($con,"UPDATE SE SET OTP_ACT = 1 WHERE MOB_NO ='$PHONE_NO'");
$objExecute = oci_execute($objParse, OCI_DEFAULT);
// Insert & commits
//$row1=oci_execute($sql1) or die(oci_error($sql1));
//If the table is updated
if($objExecute){
//displaying success
oci_commit($con); //*** Commit Transaction ***//
echo 'success';
}else{
//displaying failure
echo 'failure';
}
}else{
//displaying failure if otp given is not equal to the otp fetched from database
echo 'failure';
}
Post a Comment
0Comments