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

The Archive Base Latest Questions

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

I have this piece of PHP/HTML, wrapped in a POST form. How do I

  • 0

I have this piece of PHP/HTML, wrapped in a POST form. How do I pass only the ID for the row where the delete button is clicked back to the server?

        <table>
            <tr>
                <th>File Path</th>
                <th>Expiration</th>
            </tr>
            <?php
                $result = mysql_query ($list_query);
                $row_count = mysql_numrows ($result);

                for ($i = 0; $i < $row_count; $i++) {
                    $id = mysql_result ($result, $i, "id");
                    $path = mysql_result ($result, $i, "path");
                    $expiration = mysql_result ($result, $i, "expires");
            ?>
                    <tr>
                        <td width="60%">
                            <?php echo $path; ?>
                        </td>
                        <td>
                            <?php echo $expiration; ?>
                        </td>
                        <td>
                            <input type="submit" value="Delete Expiration" />
                        </td>
                    </tr>
            <?php
                }
            ?>
        </table>
  • 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-23T01:59:14+00:00Added an answer on May 23, 2026 at 1:59 am

    Use a hidden field within the form.

    <input type="hidden" name="id" value="<?php echo $id ?>">
    

    You should also start a new form for each new row too.

     for ($i = 0; $i < $row_count; $i++) {
                        $id = mysql_result ($result, $i, "id");
                        $path = mysql_result ($result, $i, "path");
                        $expiration = mysql_result ($result, $i, "expires");
                ?>
                        <tr>
                            <td width="60%">
                                <?php echo $path; ?>
                            </td>
                            <td>
                                <?php echo $expiration; ?>
                            </td>
                            <td>
                             <form method="POST" action="?">
                               <input type="hidden" name="id" value="<?php echo $id ?>">
                               <input type="submit" value="Delete Expiration" />
                             </form>
                            </td>
                        </tr>
                <?php
                    }
                ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Actually I have this piece of HTML code <form method=POST action=dosomething.php> <fieldset> <legend>My account</legend>
I have this piece of HTML <div id=fileTreeInviati> <ul class=php-file-tree> <li class=pft-directory> <a href=#
I have this piece of code: function MyFunction() { $.ajax({ type: POST, url: ajax.php,
Hi I have this piece of html... <a href=alcohol_calculator.php class=swfselector> &raquo; Alcohol unit calculator
I have a got piece of HTML code: <form method=post action=/> <input type=hidden name=example-name
I have this piece of code on a php page, at the bottom: window.opener.location.href=/index.html;
I have this piece of code: <li class=selected><a href=/AmIACandidate.html>Am I a Candidate?</a></li> I need
I have this piece of HTML: <div class=embed> <iframe width=300 height=200 frameborder=0 allowfullscreen= src=http://www.youtube.com/embed/123456></iframe>
I have this piece of PHP code: <?php $username=$_POST['username']; $password=$_POST['password']; if($username&&$password){ $connect=mysql_connect(localhost,root,) or die(
I have this JQuery piece of code. I want to see wht php outputs.

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.