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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:09:33+00:00 2026-05-25T17:09:33+00:00

I have the following code: <form name=votos method=post action=<?php echo $_SERVER[‘PHP_SELF’]; ?>> <?php $categorias=mysql_query(SELECT

  • 0

I have the following code:

<form name="votos" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
     <?php $categorias=mysql_query("SELECT * FROM categoria") or die (mysql_error()); ?>
     <?php while($cat=mysql_fetch_array($categorias)){
     echo "<h5>".$cat[0]." - ".$cat[1]."</h5>";
     $nomeados=mysql_query("SELECT * FROM nomeados WHERE cod_categoria='$cat[0]'") or die(mysql_error());
     ?>
     <div class="styled-select">
     <select name="voto">
     <option value=""></option>
     <?php
     while($nom=mysql_fetch_array($nomeados)){
        $nomes=mysql_fetch_array(mysql_query("SELECT nome FROM logins WHERE cod_login='$nom[0]'")) or die (mysql_error()); 
        ?>

     <option value="<?php echo $nom[0]; ?>"><?php echo $nomes[0]; ?></option>


     <?php
     }
     ?></select></div>
     <?php }
     ?>
     <input type="submit" class="botao" value="" name="submit" />
     </form>

The code shows all the categories with the nomenies in a select box.
The thing is that the select box goes to post with the same name. I don’t know how to get the information from all of the select boxes.

  • 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-25T17:09:34+00:00Added an answer on May 25, 2026 at 5:09 pm

    If you have more elements with the same name you can post them as an array

     <select name="voto[]">
    

    and than you get it in php

    $votos = $_POST['voto']
    foreach($votos as $voto){
      //do what you need to do
    }
    

    and it’s an array with all the values

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

Sidebar

Related Questions

I have code that looks like the following: <form id=MyForm name=MyForm method=post action=index.php> <input
I have the following code: <form> ............. <?php if (!isset($_FILES['before']['name'] || !isset($_FILES['after']['name']) echo '<input
I have the following code: <h2>Add System</h2> <?php echo $this->Form->create('ReleaseServer'); echo $this->Form->input('server_name',array('error'=>array( 0 =>
I have following HTML form <form action=https://sandbox.paypal.com/cgi-bin/webscr method=post id=paypalpost name=paypalpost> <input type=hidden name=rm value=2/>
I have code with the following form: <?php function doSomething{ //Do stuff with MySQL
I have the following code. def add_resume_link(name, form) link_to_function name do |page| html =
I am a PHP newb. I have the following code for a web form.
I have the following code <form name=frm1> <table id=mytable border=1 cellspacing=2 cellpadding=2> <tr> <td>
I have the following code form.label :artists which outputs <label for=artist_artist_name>Artist name</label> How did
I have the following code: // Form the continuities list string[] continuities = new

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.