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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:44:13+00:00 2026-05-15T01:44:13+00:00

I am using tiny table with some input fields for posting in a page.

  • 0

I am using tiny table with some input fields for posting in a page.
I want to retrieve the data which the user fills up for a particular instrument number.

My code

<form name="frmDeposit" action="paymentdeposited.php" method="post">
    <table cellpadding="0" cellspacing="0" border="0" id="table" class="tinytable" style="width:700px;">
        <thead>
            <tr>
                <th><h3>Email</h3></th>
 <th><h3>Amount Paid</h3></th>
 <th><h3>Instrument Type</h3></th>
 <th><h3>Instrument No.</h3></th>
 <th><h3>Date Paid</h3></th>
 <th class="nosort"><h3>Date Deposited</h3></th>
 <th class="nosort"><h3>Bank Name</h3></th>
 <th class="nosort"><h3>Slip No.</h3></th>
 <th class="nosort"><h3>Submit</h3></th>
            </tr>
        </thead>
        <tbody>
<?php
foreach($paymentsdeposited as $paymentdeposited)
{


?>
            <tr>
                <td><?php echo $paymentdeposited[email];?></td>
                <td><?php echo $paymentdeposited[amount];?></td>
 <td><?php echo $paymentdeposited[instrument];?></td>
                <td><?php echo $paymentdeposited[instrumentnumber];?></td>
 <td><?php echo $paymentdeposited[dated];?></td>
 <td><input type="text"  name="txtDateDeposited_<?php echo $paymentdeposited[pk_paymentinstrumentid];?>"  class="field date-pick"/></td> 
 <td><input type="text"  name="txtBankName_<?php echo $paymentdeposited[pk_paymentinstrumentid];?>"  class="field"/></td> 
 <td><input type="text"  name="txtSlipNo_<?php echo $paymentdeposited[pk_paymentinstrumentid];?>"  class="field"/><input type="hidden"  name="txtPaymentInstrumentNo_<?php echo $paymentdeposited[pk_paymentinstrumentid];?>"  value="<?php echo $paymentdeposited[pk_paymentinstrumentid];?>" class="field"/></td> 
 <td><input type="submit"  name="btnSubmit1"  value="Submit"/></td> 

            </tr>
<?php
}
?>

        </tbody>
    </table>

The print_r command outputs

Array
(
[txtDateDeposited_57] => 2010-05-07
[txtBankName_57] => pnb
[txtSlipNo_57] => 121
[txtPaymentInstrumentNo_57] => 57
[btnSubmit1] => Submit
[txtDateDeposited_51] => 
[txtBankName_51] => 
[txtSlipNo_51] => 
[txtPaymentInstrumentNo_51] => 51
[txtDateDeposited_52] => 
[txtBankName_52] => 
[txtSlipNo_52] => 
[txtPaymentInstrumentNo_52] => 52
[txtDateDeposited_45] => 
[txtBankName_45] => 
[txtSlipNo_45] => 
[txtPaymentInstrumentNo_45] => 45
[txtDateDeposited_47] => 
[txtBankName_47] => 
[txtSlipNo_47] => 
[txtPaymentInstrumentNo_47] => 47
)

I want to retrieve the values for id 57 for which he has entered values. But i am unable to construct logic for retrieving this value. I want to make it dynamic.

  • 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-15T01:44:14+00:00Added an answer on May 15, 2026 at 1:44 am

    Use explode. E.g.:

    foreach ($POST AS $key => $value) {
        if (strpos ($key, '_') !== false) {
            list($field, $id) = explode ('_', $key, 2);
    
            if ($value) {
                var_dump ($field, $id, $value);
            }
        }
    }
    

    Or if you know the Id:

    var_dump ($_POST['txtPaymentInstrumentNo_'.$Id]);
    

    Edit

    Simpler code. thx to notJim.

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

Sidebar

Related Questions

I've recently created a very simple CRUD table where the user stores some data.
When reading some JSON data structures, and then trying to Dump them using YAML::Tiny
I'm writing a tiny program that takes user input using Getops, and based on
I am using Tiny MCE which is a javascript file that allows you to
Using a populated Table Type as the source for a TSQL-Merge. I want to
I am using tiny mce with a script I built for uploading some content
I am using a tiny mce html editor in a aspx page but i
I am using the Tiny slideshow in my asp.net page. It works fine in
I'm using Netbeans IDE on tiny screen of my laptop, so I don't want
I am using jquery Tiny Carousel for sliding images but our client asks 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.