:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/www/otp/**
:: Editing File: send_otp.php
<?php require 'db.php'; require 'Mail.php'; $email = $_POST['email']; $mobile = $_POST['mobile']; $otp = rand(100000, 999999); // Insert or Update OTP $stmt = $conn->prepare("INSERT INTO users (email, mobile, otp) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE otp = ?"); $stmt->bind_param("ssss", $email, $mobile, $otp, $otp); $stmt->execute(); // Send Email $from = "kreativepixelzemail@gmail.com"; $to = $email; $subject = "Your OTP Code"; $body = "Hello,\nYour OTP code is: $otp\nDo not share it with anyone."; $headers = [ 'From' => $from, 'To' => $to, 'Subject' => $subject ]; $smtp = Mail::factory('smtp', [ 'host' => 'ssl://smtp.gmail.com', 'port' => '465', 'auth' => true, 'username' => 'kreativepixelzemail@gmail.com', 'password' => 'mptbfcywptnaipoh' // App Password ]); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { header("Location: verify_otp.php?status=error&msg=" . urlencode("Failed to send OTP. Try again.")); } else { header("Location: verify_otp.php?status=success&msg=" . urlencode("OTP sent to your email.")); } exit; ?>