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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:22:24+00:00 2026-05-13T12:22:24+00:00

I have a form, depending on the selected value of my <select> box I

  • 0

I have a form, depending on the selected value of my <select> box I would like to send to a different page.

I do not know the best way to do this, but I am thinking that maybe the best way is to have an intermediate page to always post to, then have the intermediate page check the value sent from the <select> box and forward the POST values to a different page depending on what it is. If this is the best way, how can I do that? If not, what is the best way?

Thanks!!

  • 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-13T12:22:24+00:00Added an answer on May 13, 2026 at 12:22 pm

    THat’s a good way. The alternative is to use Javascript to intercept the click, rewrite the action property of the form and submit() it.

    For your PHP though:

    First page:

    <form action="intermediary.php" method="post">
      <input id="submitTo">
        <select value="1">goToFirstPage</select>
        <select value="2">goToSecondPage</select>
      </input>
    </form>

    Second page:

    <?php
      $url = "";
      if($_POST["submitTo"] == "1") $url = "http://mysite.com/firstPage.php";

     if($_POST["submitTo"] == "2") $url = "http://mysite.com/secondPage.php";
    
     header ("Location: $url");    
    ?>
    

    Don’t put actual URLs in your first page, or you’ll run into massive security issues.

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

Sidebar

Related Questions

I have a form with 2 buttons, that depending on which is selected will
I have a form that needs to go to different owners depending on the
I have a windows form and user select cloth parameters from comboboxes like country-state-city
I'm having some issues with dijit.form.Select items. In a page i have two of
I have a page where, depending on whether the value of a combobox is
I have a form with two select boxes: country and city, city depending on
I have the following code to hide/show elements depending on what value is selected
I wanted to know the best way to achieve this. I have a form
I have a form where depending on the website's brand one of two input
I have a form, and want to disable/enable its submit button depending on whether

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.