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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:54:25+00:00 2026-05-13T14:54:25+00:00

First, i would to apologize for my bad english. Suppose i have function in

  • 0

First, i would to apologize for my bad english.

Suppose i have function in controller like this :

function confirm()
    {
        $this->load->helper(array('form', 'url'));
        $this->load->library('form_validation');

        $this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email|exist[member.email]');
        $this->form_validation->set_rules('secretKey','Secret Key', 'required|callback_secret_check');

        $this->form_validation->set_message('exist',"Email don't exist");
        $this->form_validation->set_message('secret_check','Invalid confirmation code');

        if ($this->form_validation->run() == FALSE)
          {
            // if error, show form and the error msg
            $this->view->full_render('user_confirm') ;
          } else {
            // if all ok
            echo "success" ;
          }
    }

In short, this function is used to validate new user email using confirmation code. Just like we found in any site that need registration. I made this function in case some user prefer to submit his confirmation code directly using confirmation form instead of using confirmation url (we send both confirmation url and confirmation code to his email)

Just for your information, the rule “exist” is my own rule created by extending the form class to check if the email submitted is really exist. For the “callback_secret_check” rule, i create callback function (not by extending the form validation class like first rule) to check if the confirmation code submitted by the user is a valid one.

Now, suppose i have user email “example@example.com” with confirmation code “12345”. If he submit “example@example.com” with code “22323” then the system will show error message:

  • invalid confirmation code

No problem with this case.

But, if somebody submit “this.is.not.exist@example.com” with any confirmation code, the system will show error message

  • Email don’t exist
  • Invalid confirmation code

what i wanted is only

  • Email don’t exist

without showing “invalid confirmation code” because if the email did not even exist, i think we don’t need to tell anything about the confirmation code. Any clue?

thanks for your help.

  • 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-13T14:54:25+00:00Added an answer on May 13, 2026 at 2:54 pm

    In that case, don’t set the invalid confirmation code to have required. If the field only 2, you can check it in a simple if. Not all case need form_validation.

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

Sidebar

Related Questions

First off I would like to apologize beforehand, in case this turns out to
First of all, I would like to apologize for posting this again. I am
I want to apologize for my bad english first. I am trying to implement
I would like to apologize at first instant for asking some stupid question(well not
I've been thinking about playing with Java3D . But first I would like to
I would like to search my table having a column of first names and
I would like to run multiple copies of my application and force the first
First, I know about this: How would you organize a Subversion repository for in
I need to send hundreds of newsletters, but would like to check first if
I apologize if this question is a duplicate. I have read many other mysqli

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.