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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:33:08+00:00 2026-06-13T23:33:08+00:00

Hello I have problem that I’m loosing $_POST[‘id’] value from select tag after clicking

  • 0

Hello I have problem that I’m loosing $_POST['id'] value from select tag after clicking on href. Well the code is here:

$page = 1;
if (isset($_POST['id'])){
    $id = $_POST['id'];
}

echo $id[0];
?>

<ul>
    <li><a href="?show=all">Show All</a></li>
    <li><a href="?show=submitted">Show Submitted</a></li>
    <li><a href="?show=pending">Show Pending</a></li>
    <li><a href="?show=not">Show Not Submitted</a></li>
</ul>

<form action="" method="post">
    <select name="id">
        <option value="1">one</option>
        <option value="2">two</option>
        <option value="3">three</option>
        <option value="4">four</option>
        <option value="5">five</option>
        <option value="6">six</option>
        <option value="7">seven</option>
        <option value="8">eight</option>
    </select>
    <input type="submit" name="mode" value="Select" />
</form>

The idea is that after when i’ve selected some value from selected field I need to keep that value in variable and also I need for further filtering SQL query which works after <a href="">.
At the moment after submitting form I get select value, but after further filtering pressing any of <a href=""> links $_POST value dissapears… how can I keep that value after pressing on any link?

  • 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-13T23:33:09+00:00Added an answer on June 13, 2026 at 11:33 pm

    Link click always produce GET request and does not submit a form by default. So you must pass it as a query parameter:

        <li><a href="?show=all<?=isset($id) ? '&id=' . $id : '' ?>">Show All</a></li>
        <li><a href="?show=submitted<?=isset($id) ? '&id=' . $id : '' ?>">Show Submitted</a></li>
        <li><a href="?show=pending<?=isset($id) ? '&id=' . $id : '' ?>">Show Pending</a></li>
        <li><a href="?show=not<?=isset($id) ? '&id=' . $id : '' ?>">Show Not Submitted</a></li>
    

    And, of course, you will need to take it from $_GET in such case. But as you can get it from both $_POST and $_GET you may use $_REQUEST here:

    if (isset($_REQUEST['id'])){
        $id = $_REQUEST['id'];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hello i have a problem that's maybe difficult to descripe, i have an application,
Hello all I have this problem that I can't seem to fix. I've been
Hello I have this problem with PyQt4-dev-tools that include: * a user interface compiler
I have a problem with that code setContentView(R.layout.game); TextView text = (TextView) findViewById(R.id.qwe_string); text.setText(Hello
Hello I have this snippet of code that will fire some even after time
Hello all and thanks for the attention! I have a problem that must both
file = [file1,file2,...].join( ) `paste #{file}` Hello, I have this simple problem that has
Hello I have problem with followed function that should save forwarded bufferedImage on disk.
Hello I have uploaded wso2-esb 4.0.3 on a server, the problem is that for
hello i have the following problem: i have a form in that i would

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.