.php file broke my website SOLVED

Are you trying to serve the directory with Express/Fastify (assuming you are using one of those)

import a html file, should fix it

you can look my codes
im not good coder help me pls :slight_smile:

im looking, the issue seems to be that its a static site, not sure how you could fix it sorry, ill try read something about it and ill reply if i find anything

ok thanks for trying to help me

1 Like

I see some problems with your code, such as the one shown below:

Wall of code
 if (name == "") {
          alert("Please enter your name");
        } else if (!letters.test(name)) {
          alert("Name field required only alphabet characters");
        } else if (email == "") {
          alert("Please enter your user email id");
        } else if (!filter.test(email)) {
          alert("Invalid email");
        } else if (uname == "") {
          alert("Please enter the user name.");
        } else if (!letters.test(uname)) {
          alert("User name field required only alphabet characters");
        } else if (pwd == "") {
          alert("Please enter Password");
        } else if (cpwd == "") {
          alert("Enter Confirm Password");
        } else if (!pwd_expression.test(pwd)) {
          alert(
            "Upper case, Lower case, Special character and Numeric letter are required in Password filed"
          );
        } else if (pwd != cpwd) {
          alert("Password not Matched");
        } else if (document.getElementById("t5").value.length < 6) {
          alert("Password minimum length is 6");
        } else if (document.getElementById("t5").value.length > 12) {
          alert("Password max length is 12");
        } else {
          alert("Thank You for Login & You are Redirecting to HomePage");
          // Redirecting to other page or webste code.
          window.location = "https://sun-mc.glitch.me";
        }

If you wanted i could help fix that. (The main issue is the length of this if/else statement. It would make more sense to use a switch statement here)