Home>

I want to be able to log in with a password. What should I do?
In the code below, the input screen is displayed, but I do not know where to write the important password, so I can not enter it. Where should I write?
The password will be "open".

<! DOCTYPE html>
<html>

<head>
<meta charset = 'utf-8' />
<meta name = 'viewport' content = 'width = device-width, initial-scale = 1' />
<title>moderator login | simplechan</title>
<style type = 'text/css'>
body {font-family: arial, helvetica, sans-serif;color: rgb (30,30,30);font-size: 14px;background-color: rgb (240,240,240);}
#main {text-align: center;}
#footer {font-size: 10px;text-align: center;padding: 40px 20px;}
</style>
</head>

<body>
<div>
<form action = '/ mod_login /' method = 'post'>
<label><strong>Password</strong></label>
<input type = 'password' name = 'password' required>
<button type = 'submit'>Login</button>
</form>
</div>

<div>
Those who are not moderators, go away! This is a secret area for moderators only.
</div>
</body>
</html>

https://github.com/blobmon/simplechan
I want to do mod_login in the above site, but I don't know where to add the password.
If there is, I thought that it was written in simplechan/sql/functions_moderator.sql, simplechan/app/app/handler_mod.py and simplechan/app/app/templates/mod_login.html, but I tried it anywhere. It was not written.
And psql

simplech_db = # select * from moderator_list;
 username | password_md5 | session_id | expire_ts | actions_per_hour
---------- + -------------- + ------------ + ----------- + ------------------
(0 rows)


After all, since there was no user, should I make this one?

  • Answer # 1

    I don't know if you can understand it correctly because it's hard to understand,
    Does it mean "I want to authenticate with a password, but I do n’t know how to query the entered password as the correct password"?

    If it is

    , html alone is impossible.
    You need a server-side language such as PHP.
    Information such as passwords is sent in the form, but the destination is the Web server.
    In other words, the programming language to receive on that web server = the language that runs on the server side
    Processing by is required.

    Check from the perspective of

    .
    There are lots of sample codes that can be used for authentication in any language.

    Please decide which language you want to handle first and work hard from building the environment.