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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:50:26+00:00 2026-06-11T11:50:26+00:00

I want to determine which radio button is checked…This is how I populate my

  • 0

I want to determine which radio button is checked…This is how I populate my list of radio buttons:

$sql="SELECT * from intrebari where cod_chestionar='".$_SESSION['cod']."' ";
$result=mysql_query($sql);

echo "<br><br>";
echo "<table border='1'>";

while($row=mysql_fetch_array($result))

{ 
echo "<tr>";
echo "<td>";
 echo "<input type='radio' name='intrebare' value=''>";
 echo $row[denumire_intrebare];
 echo "<br>";
 echo "</td>";
 echo "</tr>";

 }

echo "</table>";

Now let’s say this brings me a list of 4 elements. How do I find out which radio buttons are checked. If is the first one or the second or… .

  • 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-11T11:50:27+00:00Added an answer on June 11, 2026 at 11:50 am

    first you need to assign some sort of unique value to the radiobutton:

       ... 
       while( $row = mysql_fetch_array($result) )
        { 
            echo "<tr><td>";
            echo "<input type='radio' name='intrebare' value='" . $row["someColumnName"] . "'/>";
            echo $row[denumire_intrebare];
            echo "<br/></td></tr>";
        }
        ...
    

    then, when a POST is done, you can retrieve that value by:

        if( isset($_POST["intrebare"]) ) {
            switch ($_POST["intrebare"]) {
                case "value1":
                     // do something
                     break;
                case "value2":
                     // do something else
                     break;
                case "value3:
                     // do something
                     break;
            }
        }
    

    it’s important to check if the value exists using isset(), because a radio button does not have to be checked

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

Sidebar

Related Questions

From within my Java program I want to determine which .NET Framework is installed
I want to determine which part of audio file contain speech or music. I
Given this string random_string= '4' i want to determine if its an integer, a
Question: Want to perform a Select Query below (must be this query): SELECT QuestionId
I am working on an iOS app, and want to determine which type of
I want to display text (relatively large) and determine which character the user touches.
Using C# I want to determine which DC (or at least which Site) the
I did some searching for determining which radio button is selected and if checkboxes
I'm trying to clean up a database and want to determine which tables are
I want to determine which view touches occurred in for the entire application, for

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.