Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6198917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:05:48+00:00 2026-05-24T04:05:48+00:00

I’m working on a web based system (PHP & MySQL) that has users who

  • 0

I’m working on a web based system (PHP & MySQL) that has users who can log in. The problem is that all this has to be very secure. Now, I’ve read up on how to store passwords, we use an encrypted connection and lots of other safety measures are taken.

The last problem I need to solve is that the administrator who sets up accounts (ie. enters names and e-mail addresses) has to invite users to the application. He needs to be able send out a generated e-mail to a new user containing a link. If the user clicks that link he will be taken to the system and he will have to set up his password. What are best practices in sending these kinds of e-mails? I’m aware that I should use some sort of hash consisting of information about the particular user in order to make sure that the user who is at the page is actually the user that has clicked on the link. What other measures should I take?

Or would it be better to auto-generate a random password, e-mail that to the new user and let him change it after his first login?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:05:50+00:00Added an answer on May 24, 2026 at 4:05 am

    IMO the best method would be to not generate a password but only a random hash which can be stored in either a separate table or with the users table. Following can be used as structures of tables:

    users:
    userid
    name
    email
    password //any hashing technique you prefer
    isactive //bool always false when user is created
    
    invites:
    inviteid
    userid
    hash
    reinvitesent //boolean
    senton
    

    Now whenever a user is added, the information is stored in the users table and an entry is generated in invites. The email that is sent contains a link like https://yoursite.com/user/activate.php?userid=x&hash=7a657ab435f4543543543543 If the userid and hash match, you ask the user to choose his/her password. If the password change is successful you change isactive to true.

    A user account cannot be used unless the isactive value is true i.e. your queries will be of type ‘SELECT fields FROM users WHERE userid = $userid AND isactive = 1’. Also you may use the senton value in invites to check if a user has not accepted an invite, you may then send an email with the link again(let’s say after 3 days) and an option to decline the invite. If you still don’t get the user’s reply in 3 days, you automatically delete the invite.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I've got a string that has curly quotes in it. I'd like to replace
I'm trying to create an if statement in PHP that prevents a single post
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.