Any Help?

So I have some code that I’m trying to use to make a randomized password protected web page, but I don’t know how to make the area where the user would input the password, or how I would compare the value that the user enters and the value that the function makes. The password itself would be given to the user on another page. Any Ideas? I’ve been working on this for weeks and I’ve only got this far.