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 7724839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:47:23+00:00 2026-06-01T04:47:23+00:00

My PHP codeigniter site sends 3 types of emails to users, they are html

  • 0

My PHP codeigniter site sends 3 types of emails to users, they are html formatted and I wish to have a ‘view this email in browser’ link option.

How can I create a reasonably secure link? 2 of the emails are sensitive in nature:

  1. New Registration: email shows their details and an activation link

  2. Forgot Pass: email shows the link to reset pass

Is it enough to just do something like this?:

$code = sha1(mt_rand(10000,99999).time().$user_email);

$link = 'email/view/' . $code . '/' . $user_id . '/';

        => http://mysite.com/email/view/c0acc09c6d00b706e1e511e52f286b1859067047/213/

So authentication would be done based on a random hash and their user_id. Is it worth hashing the user id also?

  • 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-06-01T04:47:24+00:00Added an answer on June 1, 2026 at 4:47 am

    I wouldn’t include the user_id as a URL parameter, I’d just stick with the hash.

    As soon as somebody navigates to the link, the hash should be cross-checked with those stored in your database, and if they match, pull the information associated with that e-mail (i.e. username, e-mail). When they go to fill out the form you can validate to see if their entered data is compatible.

    For example, if a user has forgotten their password, as soon as they enter their e-mail address I reset their password to a random value (stored as a hash) and use this stored hash as the URL parameter in their reset e-mail.

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

Sidebar

Related Questions

I'm moving my site from HTML/CSS into CodeIgniter. Have some experience with PHP, but
Basically, I have a CodeIgniter site that registers users through this url: http://website.com/user/register/1 Unfortunately,
I have a PHP / CodeIgniter site with basic social functionality which obviously includes
I have a PHP site (with CodeIgniter) that includes a registration form. I have
On a PHP & CodeIgniter-based web site, users can earn reputation for various actions,
I have a web site done using codeigniter php framework and mysql, i have
Well, here's the deal. I have this site with a framework called codeigniter. It's
I have taken over a CodeIgniter PHP site that dynamically generates resized images and
I try to write a site with CodeIgniter but I've a problem with PHP.
I am fairly new to PHP and Codeigniter so im sure this will be

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.