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

  • Home
  • SEARCH
  • 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 6546975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:46:26+00:00 2026-05-25T11:46:26+00:00

When a user registers, there is a random value md5(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM)) into verified column

  • 0

When a user registers, there is a random value md5(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM)) into verified column until he verifies his account. When this happen (by email), verified goes empty.

When a user wants to receive again his email verification, types his email in a textbox and there are 4 possible situations :

  1. Non valid email -> please-correct-your-email.php
  2. Valid email -> this-email-is-not-found.php
  3. Valid email + found in DB + verified -> is-already-verified.php
  4. Valid email + found in DB + not verified yet -> still-not-verified.php

My question is if my logic and construction are correct and also if I forgot something. It works correctly though.

if ($_POST["email"]) {

require_once('config.php');

    $errflag = false;

$send2email = mysql_real_escape_string($_POST["email"]);

    if (!filter_var($send2email, FILTER_VALIDATE_EMAIL)) {
    $errflag = true;
    }    

    if($errflag) {
        header("location: please-correct-your-email.php");
        exit();
    } 

    $qry = "SELECT verified FROM members WHERE email='$send2email'";
    $result = mysql_query($qry);
    $member = mysql_fetch_assoc($result);

    if($result) {
        if (mysql_num_rows($result) == 0)  {
            header("location: this-email-is-not-found.php");
            exit();
        }
        elseif ( (mysql_num_rows($result) > 0) && ($member['verified']) ) {
            header("location: still-not-verified.php");
            exit();
        }
    else {
            header("location: is-already-verified.php");
            exit();
    }
            }

                    } //this is for if post email 
  • 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-25T11:46:27+00:00Added an answer on May 25, 2026 at 11:46 am

    I’d change verified to a boolean field. It means

    verified BOOLEAN
    ------------------
    1
    0
    

    instead of “when he’s not verified, field is filled, when he’s verified, field is blank”. It’s little bit confusing.

    I’d move

        $member = mysql_fetch_assoc($result);
    

    after

    if ($result){
    

    I’d add confirm code, because it makes no sense to do email verification without secured code (verification code)

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

Sidebar

Related Questions

When a user registers, the script sends an email to verify his account. Clicking
This is the standard scenario: User registers on the site User receives an account
When a user registers, if there is an error, after submitting the page refreshes
Is there any difference in behavior of HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run registry key, when an user Logs
Say a user registers for your site, you hash the password they have chosen
When a user registers with my site I want to offer them a login
I want to create sub-domains using PHP on the fly. Suppose a user registers
When a user registers at our site we check the address with an address
I cannot seem to get a message from drupal_set_message when a user registers on
I'm trying to incorporate user statistics into a site and decided to go for

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.