Registration Form
"https://api.roojh.com/api/v1/userRegistration/sendOtp", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode(["phoneNo" => $phoneNo]), CURLOPT_HTTPHEADER => [ "Content-Type: application/json" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { return json_decode($response, true); } } if ($_SERVER["REQUEST_METHOD"] == "POST") { $name = $_POST['fullname'] ?? ''; $dob = $_POST['dob'] ?? ''; $gender = $_POST['gender'] ?? ''; $mobile = $_POST['mobile'] ?? ''; // Add default country code if not present $phoneNo = preg_match('/^\+/', $mobile) ? $mobile : "+91" . $mobile; $response = sendOtp($phoneNo); // Store data in session $_SESSION['phoneNo'] = $phoneNo; $_SESSION['name'] = $name; $_SESSION['dob'] = $dob; $_SESSION['gender'] = $gender; if ($response && $response['message'] === "An OTP has been sent to the provided phone number.") { // Redirect to next step if OTP is sent successfully header("Location: 2.php"); exit; } } ?>

Need help?
Get in touch with us today?