Not sure why my account keeps getting suspended, I've noticed that when I upload sign-up.php or upload.php or reset_password.php the account gets suspended after a while. I have shared the code of sign-up.php if there is any problem in this code please guide thanks. Here is my domain zoptinform.iceiy.com.
I'm using bin2hex function for generating password reset token in upload.php and reset_password.php. is the function banned on your server?
`<?php
require_once "error.php";
session_start();
if (isset($SESSION['loggedin']) && $SESSION['loggedin'] == true) {
// If not logged in, redirect to login page
header('Location: dashboard.php');
exit;
} else {
$domain="";
if ($SERVER['REQUEST_METHOD'] == 'POST') {
require_once 'dbconfig.php'; // Database connection
require_once 'mail.php';
// $username = $POST['username'];
$email = $POST['email'];
$password = password_hash($POST['password'], PASSWORD_BCRYPT);
$verification_code = md5(rand());
$domain = "http://".$_SERVER['HTTP_HOST']."/";
// Check if email already exists
$stmt = $conn->prepare("SELECT id FROM users WHERE email = ?");
$stmt->bind_param("s", $email);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows > 0) {
echo "<div class='alert alert-danger text-center'>Email already exists.</div>";
} else {
// Insert user data into database
$stmt = $conn->prepare("INSERT INTO users ( email, password, verification_code) VALUES (?, ?, ?)");
$stmt->bind_param("sss", $email, $password, $verification_code);
if ($stmt->execute()) {
// Send verification email
$emailto = $email;
$subject = "Email Verification";
$message = "Please click the link below to verify your email:\n";
$message .= $domain."verify.php?code=" . $verification_code;
$emailfrom = EMAIL_FROM;
$mail_flag = true;//zPHPMail($emailto, $emailfrom, $subject, $message);
if ($mail_flag === true) {
echo "<div class='alert alert-success text-center'>Registration successful. Please check your email to verify your account.</div>";
} else {
echo "<div class='alert alert-danger text-center'>Failed to send verification email.</div>";
}
} else {
echo "<div class='alert alert-danger text-center'>Error: $stmt->error</div>";
}
}
$stmt->close();
$conn->close();
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign-up Form</title>
<script src="js/jquery.js"></script>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/form-box.css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">
</head>
<body>
<div class="container form-box">
<h2 class="text-center">Sign-up</h2>
<form id="form" method="post">
<div class="form-group">
<input type="email" class="form-control" id="email" name="email" placeholder="Email" required>
</div>
<div class="form-group passwordbox" >
<input type="password" class="form-control password" id="password" name="password" placeholder="Password" required>
<i class="fas fa-eye pass-eye" aria-hidden="true"></i>
</div>
<div class="form-group passwordbox">
<input type="password" class="form-control password" id="retype-password" name="retype-password" placeholder="Retype Password" required>
<i class="fas fa-eye pass-eye" aria-hidden="true"></i>
<div class="error-message mt-2" id="password-error"></div>
</div>
<button type="submit" class="btn">Sign-up</button>
</form>
<p class="text-center mt-3">Already have an account? <a href="index.php">Login</a></p>
</div>
<script src="js/retypepass.js"></script>
<script src="js/toggle-pass.js"></script>
</body>
</html>`