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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:18:00+00:00 2026-06-11T01:18:00+00:00

I am trying to create a registration website where the users chooses amongst three

  • 0

I am trying to create a registration website where the users chooses amongst three options on the first page and after selecting, can move onto the second page where it is displays different information depending on the option selected previously.

On Registration_1.php this is the code:

<?php
$clicked = $_POST["Next"];
if(isset($_POST['Reg_type']))
{
    header('Location:Registration_2.php');
}
elseif(isset($_POST['Next']))
{
    header('Location:Registration_1.php');
    echo "Error! You must select an option!";
    // display form again here
}
?>

<form name="frmtype" action="Registration_2.php" method="post" >
<input type="radio" name="Reg_type" value="1"/> Registering myself with credit card or bank account <br/>
<input type="radio" name="Reg_type" value="2"/> Registering multiple people using credit card or bank account <br/>
<input type="radio" name="Reg_type" value="3"/> Registering multiple people using a purchase order <br/>
<input type="submit" name="Next" value="Submit"/>
</form>

How can I redirect the user back to this page if they simply click submit without choosing an option and possible display a error message, and send them to page 2 if they choose an option? Thank you

Edit: Added if block, but still moved to next page regardless of selecting an option or not. Is the header() not the correct method to move to another page?

  • 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-11T01:18:02+00:00Added an answer on June 11, 2026 at 1:18 am
    if(isset($_POST['Reg_type']))
    {
        // execute some code
        // go to page 2
    }
    else
    {
        echo "Error! You must select an option!";
        // display form again here
    }
    

    Documentation: $_POST variable

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

Sidebar

Related Questions

I'm trying to create a registration page where one person can register him/herself along
I'm trying to create a User Registration page in ASP.NET and wondering what is
I'm trying to create simple login/registration page. I'm using index.php which includes login.php in
I am trying to create a user registration page using MVC 3, so that
I am trying to create an account registration page and when I add a
I am trying to use Yii's ActiveForm to create a basic registration page with
I am trying to create the user registration views and model on my website
I am trying to create a validated registration form for my website and am
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Trying to create a macro which can be used for print debug messages when

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.