Question About Passwords

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 1
Joined: Mon Jun 14, 2021 6:45 pm

Mon Jun 14, 2021 6:51 pm

Hello everyone! I am a new user and I have a simple question. How do I set a password for a user to log in to my site with PHP? I have no MySQL database just a iOS code/host app. I know this isn’t the most secure option, but only me and my friends are on the site so it doesnt matter. Any help is appreciated.
php-forum Fan User
php-forum Fan User
Posts: 137
Joined: Mon Jun 08, 2020 2:00 am

Mon Jun 14, 2021 10:38 pm

Look up "basic authentication"; this auth setup uses your web server only and allows you to set a password to access a folder. It can be done in apache using changes to a .htaccess file, and other server software will have their own way of doing it too.

You can do something similar in PHP by storing whether the user has entered the correct password in a session and using a file to store the login details themselves, but the option above will be simpler.
php-forum GURU
php-forum GURU
Posts: 211
Joined: Wed Jun 15, 2016 8:35 am

Mon Jun 14, 2021 10:54 pm

See the answer to your auestion here : ... -question/
Post Reply