views:

136

answers:

6

I am looking for the best way to write a website login system.

I am a desktop software developer and have only done minimal website coding with html, css, and php.

My goals for the website login system are to allow users to sign up for the site, edit their profile, and view information such as purchases etc...

I would like the option to add further features in the future such as a help desk from inside of the login software.

My question is, what is the best way to do this?

  1. Code by hand: What language/framework is the best to use for this? Ruby on Rails? Symfony? CakePHP?

  2. Are there any good outsourced options to consider?

A: 
  1. The "best way" always depends on what you are planning to do, how familiar you are with the language, how complex your application will be.. All the frameworks you mentioned easily implement a user management in some way. But if you're only about to build a small website, you might be fine by writing it yourself.

Best wishes, Fabian

halfdan
A: 

Have you looked at django?

http://docs.djangoproject.com/en/dev/topics/auth/

Liz Albin
A: 

The following SO post talks about the use of PHP frameworks, which I would suggest reviewing. Most frameworks already have functionality built-in for user management and authentication.

To Use a PHP Framework or Not

Hope it helps!

Neal Swearer
A: 

Web apps are the same as desktop apps in terms of how you should develop them:

Step 1) Write the functional spec of what it is you want. Since this is a new development arena for you, I recommend an iterative project development method such as Agile .

Step 2) Create a basic design from your spec. The first iteration is/should be language/platform independent. Identify where (user input) requests will come from, what (general) component will handle the requests and directing the appropriate component to handle them.

Step 3) Look at a few technologies. See what components/features they have that will match up with the needs of your application.

Step 4) Choose the language/framework and write the very most basic piece of it that you can to demonstrate a working app. For instance, a login and username display page. This could be for instance installing Drupal, and echoing data out of a custom table on the login /welcome page.

Step 5) See if you already want to tear your hair out and poke out your own eyes. If you do at this point, go back to step 4 and do it over with something else. Each of these step 4-5 iterations should take no more than 2-3 days. Even if your very first app doesn't make you want to kill yourself, you may want to give another 2-3 day window to try one more app just to confirm you have the right stuff.

Step 6) Stick with your choice and write a few additional small components. If you find you want to kill yourself in the first 2 weeks, you should identify on paper what the shortcomings specifically are and see if you can write a library for that stuff, or give one last shot to choosing another framework.

Step 7) Suck it up and build the app. Hopefully you can release the components AND documentation open source for the libraries you used to make your life liveable while building the app and save us all a lot of time as well.

Zak
A: 

Creating a login system is actually quite straight foreward. You need to be able to have a member create a login with a username and a password. Store this information somewhere, ususally in a database. And then retrive this via a form calling the database and verifing that the provided username and password match.

The doc that Liz referenced is a pretty good overview of the details involved in a making a full fledged system.

netTuts has a video which uses the CodeIgniter PHP framework and MySQL to create a simple login system. I would say watch that, read the documents and then use your knowledge to create the system that works best for you.

Good luck, and hope this helps.

Chris
+1  A: 

writing a login system is easy as it sounds first you need a database which on you save username and userpassword now you need a form in that for you pass input name some name like 'username' 'password' then you pass as file the file on which you post the entered data. in your file first you get the username like this $name =$_post['username']; $pass=$_post['password']; now you need to connect to your database that you can compare the entered username and the antered passwords that match or you can define a predefinied value like mypassword here is an example

session_start();
if(isset($_POST['login']))
{
$password = $_POST['pswd'];
if ( $password == "mypassword" )
 { //Replace mypassword with your password it login
    $_SESSION['phplogin'] = true;
    header('Location: index.php'); //Replace index.php with what page you want to go to after succesful login
    exit;
} 
else
 echo "enter the correct login details";
birrer