LittleDemon WebShell


Linux in-mum-web1499.main-hosting.eu 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64
Path : /home/u901718425/domains/task.urbanpillar.in/public_html/
File Upload :
Command :
Current File : /home/u901718425/domains/task.urbanpillar.in/public_html/register.html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>User Registration</title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="bg-light d-flex justify-content-center align-items-center vh-100">
  <div class="card p-4 shadow w-50">
    <h4 class="mb-3">User Registration</h4>
    <form id="registerForm">
      <div class="mb-3">
        <label for="user_name" class="form-label">Name</label>
        <input type="text" class="form-control" id="user_name" name="user_name" required>
      </div>
      <div class="mb-3">
        <label>Email</label>
        <input type="email" class="form-control" id="regEmail" required>
      </div>
      <div class="mb-3">
        <label>Password</label>
        <input type="password" class="form-control" id="regPassword" required>
      </div>
      <div class="mb-3">
        <label>Confirm Password</label>
        <input type="password" class="form-control" id="confirmPassword" required>
      </div>
      <button type="submit" class="btn btn-success w-100">Register</button>
    </form>
    <div id="regMsg" class="mt-3 text-center"></div>
  </div>

  <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
  <script>
    $('#registerForm').submit(function (e) {
      e.preventDefault();

      const email = $('#regEmail').val();
      const name = $('#user_name').val();
      const password = $('#regPassword').val();
      const confirmPassword = $('#confirmPassword').val();

      if (password !== confirmPassword) {
        $('#regMsg').html('<div class="text-danger">Passwords do not match.</div>');
        return;
      }

      $.post('/register.php', {
        email: email,
        user_name: name,
        password: password
      }, function (res) {
        if (res.success) {
          $('#regMsg').html('<div class="text-success">Registration successful. You can <a href="/">login now</a>.</div>');
          $('#registerForm')[0].reset();
        } else {
          $('#regMsg').html('<div class="text-danger">' + res.message + '</div>');
        }
      }, 'json').fail(function () {
        $('#regMsg').html('<div class="text-danger">Server error. Please try again.</div>');
      });
    });
  </script>
</body>
</html>

LittleDemon - FACEBOOK
[ KELUAR ]