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

The Archive Base Latest Questions

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

Basically I wish to write my registration page in such a way that errors

  • 0

Basically I wish to write my registration page in such a way that errors (such as invalid username, short password, too long username, invalid email, etc.) are returned (at the same time) when user is redirected back to the same page.

I have often seen a lot of websites that have this:

There are X errors in the data you submitted:

  1. Username is too short
  2. Password is too short
  3. Etc. etc.

And these errors are returned when the user submits the form and is redirected back.

I thought of returning the errors via numbers in $_GET however I’d like to avoid this. And I also would like to avoid using JS/AJAX and $_SESSION.

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

    With a library:

    if ($_POST)
    {
        $form_helper = new FormHelper();
    
        $form_helper->validate($_POST["username"], "username");
        $form_helper->validate($_POST["password"], "password");
    
        if (! $form_helper->notifications())
        {
            // Process form.
        }
    }
    
    // Show errors if necessary when rendering the form.
    

    Without a library:

    $errors = array();
    
    if ($_POST)
    {
        // Validate username by hand (let's pretend it passes).
        // Validate password by hand (let's pretend it fails).
    
        array_push($errors, "The username or password is incorrect.");
    
        if (! $errors)
        {
            // Process form.
        }
    }
    
    // Show errors if necessary when rendering the form.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What I basically wish to do is design a generic interface that, when implemented,
Basically I have an idea for a Facebook Application that I wish to build.
basically i have a page on my site with boxes that slide to reveal
Basically I am trying to restart a service from a php web page. Here
Basically I’ve heard that certain conditions will cause .NET to blow past the finally
Basically I'm trying to accomplish the same thing that mailto:bgates@microsoft.com does in Internet Explorer
I have a template function in C++ that basically writes values to an XML
We wish to make a desktop application that searches a locally packaged text database
basically i wish to achieve like user type file name,then video will be pop
I wish to do something iframe-like with my div i've got going here. Basically,

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.