Plz help me in this security program that i made

project

#1


There is a function called "num" that prompts and your input goes in but after some tests, the function is undefined according to the computer. At least that is the only problem that I found. Check it out yourselves.

var letter = '"';
var variable = true;
var number = [];
var storage = [];
var num = function () {
    prompt("Please enter you sign in number");
}
var a = (storage[num]);

var form = function () {
    var title = prompt("Title of site");
    var site = prompt("Site");
    var userName = prompt("User Name");
    var password = prompt("Password");
    var html = ("<a href=" + letter + site + letter + "<h3>" + title + "</h3><h6>" + userName + "</h6><p>" + password + "</p></a>");
    var a = storage[num];
    a = a + html;
    document.write(a);
}
        
    
    //signUp
    var signUp = function () {
    var signUpNumber = -1;
   
   //
    var x = prompt("Hi, please enter the password that you would like to sign up with /Slide down the text bar in the prompt to ensure that nobody sees the password/.");
    

   
    var y = prompt("Please enter it again /Slide down the text bar in the prompt to ensure that nobody sees the password/");
    

   // 
    if (x === y) {
        number.push(x);
        
         //number counter
        
        while (variable) {
            signUpNumber = signUpNumber + 1;
            alert("Your sign in number is" + " " + signUpNumber + ".");
            variable = false;
        }
        
        //number counter
    }   
    
    else {
        window.close();
        return "Access Denied";
    }
}
//signUp
signUp();
    
    //signIn
 var signIn = function () { 
    num;
    
    var password = prompt("Password /Slide down the text bar in the prompt to ensure that nobody sees the password/");
    console.log(number[num]);
    if (password === number[num]) {
        alert("Welcome");
        return "Hello";
        
    }
    else {
        window.close();
        return "Access Denied";
    }
    
}
//signIn
signIn();

//security  
  var security = function () {
      
      if (console === number) {
          window.close();
          return "Access Denied";
      }
      if (document === number) {
          window.close();
          return "Access Denied";
      }
      if (everything === true) {
      }
      else {
          window.close();
          return "Access Denied";
      }
  }     
  //security


#2

I think your problem is that you didn't call num() with parenthesis. :slight_smile:

num and num() are completely different, as one is a function and the other is a variable name.


#3

Thanks cade:slight_smile:codes


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.