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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:10:05+00:00 2026-06-15T10:10:05+00:00

I have a button on a page that when a user pushes it, it

  • 0

I have a button on a page that when a user pushes it, it creates another “radio element” on the page. The problem though is that I am having a hard time retrieving the value with PHP after the form is submitted.

Here is my HTML code:

<input type="radio" checked="checked" id="rad-3" title="member-section" name="use_name[0]" value="Test!" />

Here is my PHP code:

if ($_POST['use_name[0]'] == 'Test!') {
    echo 'It Worked!' ;
} else {
    echo 'Nope!' ;
}

Whenever my form is submitted, Nope! is always echoed out. Any help is appreciated!

  • 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-15T10:10:07+00:00Added an answer on June 15, 2026 at 10:10 am

    PHP will receive $_POST['use_name'] as an array, with the [0] key you specified in the HTML. So you want to test:

    if ($_POST['use_name'][0] == 'Test') {
     // ....
    }
    

    Debug with print_r($_POST) to see the structure of the array.

    Note that if you don’t have a need to send specific array keys in the HTML, you can just name the inputs like name='use_name[]' and PHP will receive them as a numeric-indexed array. You can be more specific if needed, with string keys too: name='use_name[first_value]' and PHP will receive the string keys as in $_POST['use_name']['first_value']

    Note however, that this is not a typical way to use radio buttons. Since only one is usually selected, unless you are listing multiple radio buttons (we don’t see your HTML) all with the name name='use_name[0] the buttons will not be bound as a radio group. They must all have the same name, and different array keys will turn them into different radio groups. This is more commonly used for checkboxes.

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

Sidebar

Related Questions

I have a button on a page that when a user pushes it, it
I have a page with some user selectable options and a button that, when
I have button on the page that being used as a link to another
I have a link/button on my page that should lead the user to a
I have a page that that contains a User Control and a submit Button.
I have a button on an aspx page that is supposed to send an
I have an aspx page that contains a checkbox, and a button. The button
I have a form in an HTM page that, after pressing the submit button,
I have an asp.net page. There is a button Edit on the bottom that
I have buttons on a page that look like: <p> <a href=view.php> <input type=button

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.