I want a very simple login functionality integrated into a form on my server. It would be for use with only one page. You login in order to upload files to the server. I use a Linux at the moment. Does anyone have an idea of where I could get an idea where to get started. I have HTTPS/SSL Certificate on the server so it will help. But I don't really want to get complicated, only enough to stay secure. Ideas? Hope I'm in the right place. I'd like to use PHP to do this. The goal is to create a login without using SQL maybe, as it is only for one or two users.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Something like,
$hash = "precomputed hash of your password";
if (crypt($_POST['password'], '$6$rounds=5000$usesomesillystringforsalt$') == $hash) {
...
}
No database is needed.
回答2:
You could just use htaccess to password-protect a directory (cpanel/plesk make this easy to do), or give your users an FTP account to upload files.
Either one would be quick and easy to setup, with FTP being more secure (assuming a reasonable password).
回答3:
its easy, you just nees to filter input so that your script save from sql injection, if you want to build this functionality on same page then u must use propper conditions to check incoming post data,
php's FILTER_SANITIZE_(check string,password,number,or other things)
is very handy in this way