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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:03:39+00:00 2026-06-07T03:03:39+00:00

im new here. i have problem and in great hurry :( scenario : i

  • 0

im new here. i have problem and in great hurry 🙁
scenario : i want to make an dynamic input form. user input a number of columns and rows they want. then, it generate the table as the number inputted in previous form. after that, user input a random number to the table, and click submit button. system will record the data and process it. finally, system will show the average (just the example).

table generate succesfully. the problem is how to save/read the data inputted in input form.

this is input.php

<tr> 
<td width="30%" align="left" valign="top">Input the number of columns     :<td      height="37" align="left" valign="top"><input type="text" name="colums" value="" /></td> 
</tr> 
<tr> 
<td align="left" valign="top">Input the number of rows :</td> 
<td width="70%" align="left" valign="top"><input type="text" name="rows" value="" /></td> 
</tr> 
<tr> 
<td align="left" valign="top">&nbsp;</td> 
<td align="left" valign="top"><input type="submit" name="button" id="button" value="Submit" /></td> 
</tr> 
</table> 
</form> 

and the result php like this..

<?php 
$columns = $_POST['columns']; 
$rows = $_POST['rows']; 

echo "<form method='post' action='process.php'>"; 
echo "<table>"; 

//made the rows 
for ($i= 0; $i <= $rows-1; $i++){ 

//and the colums 
echo "<tr>"; 
for ($j = 0; $j <= $colums-1; $j++) { 

//here is the input form, and each of data inputed here that i want to save it. 
$sum = array('[$i][$j]'); 
echo "<td> </td> 
    <td><input size='5' type='text' name='data".$sum."' /></td> 
"; 

}
echo "</tr>";  
} 


echo "<tr><td></td><td><input type='submit' name='submit' values='Submit' /></td></tr>"; 
//im not sure here in value='$sum' 
echo "<tr><td></td><td><input type='hidden' name='banyak' value='$sum' /></td></tr>"; 
echo "</table>"; 
echo "</form>"; 

// here,which one should i $_GET[''] ? 

?>

and the process.php show the average from data. i made it totally wrong in process.php

  • 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-07T03:03:40+00:00Added an answer on June 7, 2026 at 3:03 am

    Check this:

    <?php 
    $columns = 3; //test value
    $rows    = 2; //test value
    
    echo "<form method='post' action='process.php'>"; 
    echo "<table>"; 
    
    //made the columns 
    for ($row_idx= 0; $row_idx <=$rows-1; $row_idx++){ 
    
        //and the rows 
        echo "<tr>"; 
        for ($col_idx = 0; $col_idx <= $columns-1; $col_idx++) { 
    
        //here is the input form, and each of data inputed here that i want to save it. 
        $sum = array('[$row_idx][$col_idx]'); //??? What's for that?
        echo "<td></td> 
            <td><input size='5' type='text' name='data[{$row_idx}][{$col_idx}]' /></td> 
        "; 
    
        } 
    }
    
    echo "</tr>"; 
    echo "<tr><td></td><td><input type='submit' name='submit' values='Submit' /></td></tr>"; 
    //im not sure here in value='$sum' 
    echo "<tr><td></td><td><input type='hidden' name='banyak' value='$sum' /></td></tr>"; 
    echo "</table>"; 
    echo "</form>"; 
    
    // here,which one should i $_GET[''] ? 
    
    echo "<PRE>";
    print_r($_REUQEST['data']);
    echo "</PRE>";
    
    ?>
    
    1. You sould name your variables to be understandable.
    2. You should name your input fileld like an array and it will be parsed by php, so <input name='data[1][2]' value="foo"> will “arrive” to by like $data = array('1' => array('2' => "foo"));
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new here and have a problem. I am having to pick up C#
I'm new here and I have a problem with the jQuery's function - animate
I'm quite new here. I have a problem with the new iOS 5.1 slide-in
am new here. i have a slight problem; PLease look at the following code
I am new to c# and I have this problem: I have here a
I'm new here and kinda new to java. I've encountered a problem. I have
Here's the situation: I have a great big text input box for a URL
Hi I am new to MVC and have looked through a great number of
I'm new around here and i have a little problems with a C# application.
i'm new here and i have a question. I am trying to insert 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.