Skip to content Skip to sidebar Skip to footer

Javascript Sign-on, Basic Knowledge

I'm building a small website in my spare time, at the moment solely based on HTML, Javascript, PHP (though my PHP skills are rudimentary) and a simple MySQL db. Now I would like to

Solution 1:

Logins are best handled with PHP rather than JS because with PHP you can use your database to save usernames and password etc. With JS your users need to be hardcoded in the script which is very very insecure and can be seen by anyone when checking the source code.

Try this tutorial to get a better understanding of making a simple PHP login system:http://www.wikihow.com/Create-a-Secure-Login-Script-in-PHP-and-MySQL.

When you're done with the tutorial you'll be definitely capable of making a login system.

I wish you the best of luck and hope it'll help you out!

Solution 2:

Sometimes you just need to jump in the deep end of the pool, so I am going to recommend you try to implement login via OPENID so that people use their existing Yahoo or Google accounts to log in. Actually, it works with a few dozen providers....

This means you do not have to store people's passwords or mail them reset links, so there are long term benefits to doing things this way.

People lie about their real name on Yahoo or Gmail all the time, but at least you'll get an email address and some sort of name out of them that they are also possibly using elsewhere.

Here is a PHP library for OPENID: https://github.com/openid/php-openid

Solution 3:

Check the Authentication section from PHP Developer Guide to implement basic authentication.

Solution 4:

Start with HTML authentication using JS and PHP. This is a good place to start: http://php.net/manual/en/features.http-auth.php. After this (slightly inflexible but useful) method is mastered, you can design your own way using JS and Ajax. Just do not assume that there is any guarantee of security inherent in any of these techniques (there is none). For that you need SSL on top of whatever authentication scheme you are using.

Here is a link that handles HTML auth in full detail: http://www.phpro.org/tutorials/Basic-Login-Authentication-with-PHP-and-MySQL.html but basically Google around for HTML authentication with PHP and JavaScript.

Post a Comment for "Javascript Sign-on, Basic Knowledge"