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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:32:55+00:00 2026-06-15T20:32:55+00:00

I am running the following test below and entering some text into the first

  • 0

I am running the following test below and entering some text into the first text box out of the 20. I am simply trying to echo out the post value in the spec.php page for further processing. When I try it echo’s nothing. My question is, how come if I generate input element code using a loop, where every input ‘name’ attribute is unique, the $_POST variable you would expect to be passed on to spec.php does not echo out?

<form action="spec.php" method="post">
<?php
    for($i=0; $i < 20; $i++){
        echo '<input type="text" style="border:2px solid red;" name="inp'.$i.'" />';
    }

?>
<input type="submit">

spec.php

echo $_POST['inp0'];
  • 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-15T20:32:56+00:00Added an answer on June 15, 2026 at 8:32 pm

    First debug your $_POST with the following:

    print_r($_POST);
    

    See if all your inputs are in there.

    Edit:
    I just used the following and it works!

     <form method="post" action="action.php">
     <?php
      for($i=0; $i < 20; $i++){
        echo '<input type="text" style="border:2px solid red;" name="inp'.$i.'" />';
      }
      ?>
     <input type="submit">
    

    action.php

    <?php print_r($_POST);
    

    result:

    Array
    (
    [inp0] => one 
    [inp1] => two
    [inp2] => three
    [inp3] => four 
    [inp4] => five
    [inp5] => six
    [inp6] => seven
    [inp7] => blah
    [inp8] => blah
    [inp9] => blah
    [inp10] => blah
    [inp11] => blah
    [inp12] => 
    [inp13] => 
    [inp14] => 
    [inp15] => 
    [inp16] => 
    [inp17] => 
    [inp18] => 
    [inp19] => 
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When running the following code, the filenames of all files below C:\Test are printed.
I am running following LINQ query in order to group by CategoryID var test
We get the following error when running at test: ContextSwitchDeadlock was detected Message: The
Running the following (example) code import java.io.*; public class test { public static void
I have the following error when running the page below: this.testpublic is not a
I'm running the below script with cron, in /etc/cron.d/mycron I have the following: */10
the following script text.pl (described below) define to append the $insert text between $first_line
Running SQL 2005 X64. First, create the following stored proc on a database: CREATE
For some reason, the following seems to work perfectly on my ubuntu machine running
I am running the following code in a JUnit test to test fetching a

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.