6 Replies - 400 Views - Last Post: 16 September 2013 - 08:29 AM

#1 Java Student  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 21
  • View blog
  • Posts: 480
  • Joined: 05-February 10

Basic website login structure

Posted 15 September 2013 - 01:34 PM

I don't know what the best structure is in order for users to login to a website.

Currently, users go to www.somewebsite.com, arrive at my index.html, they input text on index.html and hit Login button, then taken to login.php which tries to connect to database with login info, if failed, taken back to index.html, if not failed, taken to usermenu.html.

The assignment is to create a facebook or twitter-like blog, with user accounts and posts.

I'm just looking for the best structure to do this.

Is This A Good Question/Topic? 0
  • +

Replies To: Basic website login structure

#2 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3362
  • View blog
  • Posts: 11,398
  • Joined: 12-December 12

Re: Basic website login structure

Posted 15 September 2013 - 02:05 PM

I presume there are some other requirements to your assignment? Is PHP to be used? Can you use a Framework? etc..

There are a large selection of PHP tutorials here @DIC; click the Tutorials link at the top of the page.

This post has been edited by andrewsw: 15 September 2013 - 02:06 PM

Was This Post Helpful? 1
  • +
  • -

#3 laytonsdad  Icon User is offline

  • Cheese and Sprinkles
  • member icon

Reputation: 436
  • View blog
  • Posts: 1,848
  • Joined: 30-April 10

Re: Basic website login structure

Posted 15 September 2013 - 02:22 PM

Here is the basic model http://creately.com/...2/login+process

Spoiler


There are also things like lost password and verification of email that can be added.

Once the user is logged in they should then be sent to a user only part of the site, depending on what credentials, they will get certain abilities such as adding, editing, or removing a post.
Was This Post Helpful? 1
  • +
  • -

#4 Java Student  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 21
  • View blog
  • Posts: 480
  • Joined: 05-February 10

Re: Basic website login structure

Posted 15 September 2013 - 02:39 PM

The only requirements are that PHP is to be used to connect to a MYSQL db. Other than that, I can use javascript ajax, html, css, php, etc...

I think I was just curious if it mattered that login information is inputted on a .html, then sent to a .php to handle db connect, then redirect back to index. Or have just one .php that has html in it to handle forms and connect to db all in one .php

I liked the login process chart as a reference, Layton.
Was This Post Helpful? 0
  • +
  • -

#5 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1359
  • View blog
  • Posts: 3,425
  • Joined: 28-November 09

Re: Basic website login structure

Posted 15 September 2013 - 02:42 PM

Realistically you're going to have to make all the pages in PHP, otherwise how can you dynamically check if someone is even logged in?
Was This Post Helpful? 0
  • +
  • -

#6 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3362
  • View blog
  • Posts: 11,398
  • Joined: 12-December 12

Re: Basic website login structure

Posted 15 September 2013 - 02:57 PM

laytonsdad said:

Once the user is logged in they should then be sent to a user only part of the site

I just wanted to comment on the implication of this, as this approach can lead to a lot of extra work. That is, essentially running two versions of the site in parallel. Most substantial (with user-registration) sites don't do this (unless I'm mistaken?). A templating (block/includes) approach is taken. That is, when a page is visited, it is determined whether the user is logged-in, in which case additional features/functionality are added to (included with) the page. But, yes, redirects are also used to provide, effectively, two versions of a page, and some pages will only be accessible to logged-in users.

Someone with more experience might explain this better, but the essential point I'm trying to convey is that it is a lot of extra work to build, and maintain, two (or more) versions of a site.

This post has been edited by andrewsw: 15 September 2013 - 03:08 PM

Was This Post Helpful? 0
  • +
  • -

#7 laytonsdad  Icon User is offline

  • Cheese and Sprinkles
  • member icon

Reputation: 436
  • View blog
  • Posts: 1,848
  • Joined: 30-April 10

Re: Basic website login structure

Posted 16 September 2013 - 08:29 AM

@andrewsw
I did not mean that the site should have two seperate pages for logged in and guest users simply added functionality for those logged in. :whistling:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1