+ Reply to Thread
Results 1 to 9 of 9

Thread: Help need to create a PHP members area

  1. #1
    graphico is offline x10Hosting Member graphico is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    20

    Unhappy Help need to create a PHP members area

    Hello I am fairly new to Php and want to create a feature on a site which allows paid up members to login to various areas of the site.

    I have got past creating login forms and I have set up Wamp... but I’m not sure what else i need to include to make the members area work.



    Does anyone have a constructive list of files I need to create?

    All help appreciated

  2. #2
    essellar's Avatar
    essellar is offline Community Advocate essellar has a spectacular aura about
    Join Date
    Feb 2010
    Location
    Toronto, Ontario, CA
    Posts
    1,153

    Re: Help need to create a PHP members area

    All you need (he said, as if it were nothing) is an indication in your database (either in the user record, or in a table you can join to the users table) of whether the user is paid up or not, and to what date. You would use that value to determine whether or not to set a user session variable to "valid" (along with the username and password checking, of course). Every page in your members area should have a "session_valid?" check at the top that redirects the user either to the login page (if the username/password check fails) or to a "not paid" page if the username/passord check passes, but the subscription has expired (allow a few days' grace as a courtesy).

    Maintaining the subscription data, on the other hand, depends on the method of payment. Payment processors (like PayPal) usually have an API that either messages your server on payment (either by POST request or by mail -- prefer POST if you get a choice) or that your server can query for account updates. If you are maintaining the list manually, you'll need to either create a form/page/script to maintain the payment table (or, if you're masochistic, you can use phpMyAdmin to work on the table directly). If you are using a payment processor, see their developers site for information about the APIs and requirements.
    “Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
    "It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)

  3. #3
    ralcala21's Avatar
    ralcala21 is offline x10Hosting Member ralcala21 is an unknown quantity at this point
    Join Date
    Jul 2010
    Posts
    1

    Lightbulb Re: Help need to create a PHP members area

    This login form -> admin area is a very asked / discussed topic so don't be afraid of asking these things, my experience with PHP/MySQL is only about 2 years but as the previous user mentioned you need and attribute that can identify users inside your website. This attribute is often called "Role" each role has different "privileges" inside your system, those depend on you, for example visitors, paid user and admins can have access to different areas in your system.

    Well to sum up your question. I will list some things you'll need to consider:
    1. Add a Role attribute to your Users
    2. For security purposes your Users' credentials should be separated from your Users' info in a table called "Credentials" maybe. You can store here username, password and role.
    3. Make your users use a strong password. Require a minimum of 8 characters and advice them to use numbers and letters with special characters.
    4. If you are not using HTTPS for your login, always use POST method and cypher the password using Javascript. User SHA1 or SHA256 algorithms.
    5. Also save passwords cyphered in your database.
    6. Decide if your gonna use
      Code:
      $_SESSION
      variables,
      Code:
      $_COOKIE
      variables, DB session management or a combination of the previous to manage your sessions. This depends on how much control you have over your server and how many users you have in your website.

    Well there many more things to consider, but I think these can give you a nice clue to start and dig more info on Google. Remember that security is the most important thing on a web application but it has to go hand in hand with performance and usability.

    Good luck!

  4. #4
    graphico is offline x10Hosting Member graphico is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    20

    Smile Re: Help need to create a PHP members area

    Wow Thanks esseller and rascala21, useful information I think im going to have to have a lie down before I can handle this, do you know of any good tutorials to cover this topic.

    Cheers again guys

  5. #5
    essellar's Avatar
    essellar is offline Community Advocate essellar has a spectacular aura about
    Join Date
    Feb 2010
    Location
    Toronto, Ontario, CA
    Posts
    1,153

    Re: Help need to create a PHP members area

    Actually, security should go against performance; "high-performance" security features make brute-forcing easier. And when payment is involved, keep the info out of the browser (that is, use server-side sessions rather than cookies to hold session data). (And since it is possible to edit your live web page locally and otherwise monkey with cookies, it's better to leave cookies out of the deal altogether except for "unimportant" things like preferences. Session cookies should always be checked against server-side sessions for validity.)
    “Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
    "It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)

  6. #6
    callumacrae's Avatar
    callumacrae is offline not alex mac callumacrae is just really nice
    Join Date
    Dec 2007
    Location
    Wellesbourne, England
    Posts
    5,162

    Re: Help need to create a PHP members area

    I can customise your phpBB board. Send me a PM.
    lynxphp - info, tutorials and scripts
    "A forum post should be like a skirt; long enough to cover the subject but short enough to keep things interesting."

  7. #7
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: Help need to create a PHP members area

    That's probably one you should avoid; sure it's very simple to understand but it also has more security issues than I care to count. For example, it's keeping the actual password value in plain-text in a cookie and is then failing to hash it when in the database.

  8. #8
    callumacrae's Avatar
    callumacrae is offline not alex mac callumacrae is just really nice
    Join Date
    Dec 2007
    Location
    Wellesbourne, England
    Posts
    5,162

    Re: Help need to create a PHP members area

    whaaat. That's rubbish. Don't use that one

    ~Callum
    I can customise your phpBB board. Send me a PM.
    lynxphp - info, tutorials and scripts
    "A forum post should be like a skirt; long enough to cover the subject but short enough to keep things interesting."

  9. #9
    graphico is offline x10Hosting Member graphico is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    20

    Re: Help need to create a PHP members area

    Thanks for all the replies, im using this tut at the moment..http://www.1stoptutorials.com/Create...a-Lesson2.html

+ Reply to Thread

Similar Threads

  1. Members Area?
    By mxc10160 in forum Programming Help
    Replies: 6
    Last Post: 03-15-2009, 11:29 AM
  2. Members Area
    By dinokill in forum Scripts & 3rd Party Apps
    Replies: 5
    Last Post: 03-29-2008, 12:47 PM
  3. Members' Area
    By Grandcruiser in forum Scripts & 3rd Party Apps
    Replies: 1
    Last Post: 06-27-2007, 05:03 PM
  4. Test my members area
    By dharmil in forum Scripts & 3rd Party Apps
    Replies: 10
    Last Post: 03-22-2006, 12:34 PM
  5. What shoul i put in My Members area?
    By minievan in forum Off Topic
    Replies: 9
    Last Post: 12-08-2005, 10:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers