//*
<html>
<head>
</head>
<body>
<form id="sms2" name="sms2" method="POST" action="index.php?option=com_content&view=article&id=83&Itemid=654">
<table width= "400">
<tr>
<td align="right" valign="top">Verification Code:</td>
<td align="left"><input type="textarea" name="veficationcode" cols="82" rows="5" id="veficationcode"></textarea></td>
</tr>
<tr>
<td colspan="4" align="right"><input type="submit" name= "submit" value="submit"/>
</td>
</tr>
</table>
</form>
</body>
</html>
{source}
<?php
$phverf= rand();//stores the value of rand function in phverf variable
echo "$phverf" . "\n"; // echo this just to check...when users inputs the random number received on sms
Global $_CB_framework;
$myId = $_CB_framework->myId();
$cbUser =& CBuser::getInstance( $myId );
if ( ! $cbUser ) {
$cbUser =& CBuser::getInstance( null );
}
$user =& $cbUser->getUserData();
Echo $myId;
$firstname = $cbUser->getField('firstname');
echo $firstname;
$servername = "";
$username = "";
$password = "";
$dbname = "";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "UPDATE t4qcm_comprofiler SET cb_phoneverificationcode ='$phverf'
WHERE id = $myId";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
Please Log in to join the conversation.
Please Log in to join the conversation.
var_dump($row['cb_phoneverificationcode']);
var_dump($row['cb_userinputphonecode']);
if($row['cb_userinputphonecode'] == $row['cb_phoneverificationcode']){ echo "SUCCESS!!! With values - User Input : ".$row['cb_userinputphonecode']." And Phone Verification : ".$row['cb_phoneverificationcode']; }else{ echo "verification code mismatch. Please try again"; }
print_r(mysqli_fetch_assoc($result));
$connect->close();
}
?>
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.