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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:00:46+00:00 2026-06-17T06:00:46+00:00

I have two php pages and I’d like to check which button is checked

  • 0

I have two php pages and I’d like to check which button is
checked in the fist one so be able to use its value in the next php
page.The problem is that the submit button is into a while loop so I
can’t use different values, may it can be using an i variable but I
don’t know how. form of the first page is:

<form name="myForm" action="admin.php" method="post">   
<table BORDER=1....... > <?php $link = mysql_connect('localhost', 'root', '');  if
(!$link) { 
   die('Could not connect: ' . mysql_error()); }
   mysql_select_db("nowdeal"); 
   $query = mysql_query("SELECT * FROM application ORDER BY date");
   WHILE($rows = mysql_fetch_array($query)):
         $date = $rows['date'];
         $username = $rows['username'];
         $advers = $rows['advers'];
         $id = $rows['id'];
         echo '<tr>';
         echo "$date";
          echo "</br>";             
          echo "$username";
          echo "</br>";
          echo "$advers";
          echo "</br>";
          echo "$address";
          echo "</td>";
          echo '<td align="left">';
          echo '<input type="submit" name="action" value="edit" />';
          $_SESSION["id"]=$id;
          echo '</td>';
          echo '</tr>';
          endwhile;  ?>    </table> </form>

in the next page, php code is like:

<?php session_start();
  $con = mysql_connect("localhost","root","");    if (!$con)      {  
  die('Could not connect: ' . mysql_error());   }
  mysql_select_db("nowdeal", $con); 
  mysql_query("SET names 'utf8'");
  if(isset($_POST['paid']))     
  { if($_POST['paid']=="yes")  ///is a value from a drop down list 
  {mysql_query("UPDATE application SET paid='yes' WHERE .....");}  

 ///i want to be like : WHERE id=session[id], but when it works it
 takes only   //the last id ,so be upadated the last row only 
  ?>
  • 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-17T06:00:48+00:00Added an answer on June 17, 2026 at 6:00 am

    If you want to pass a value over to your new form, insert the value into a hidden form element:

    echo '<input type="hidden" name="sessionId" value="' . $id . '"/>';
    

    So that in your next page, you can access this value using:

    $_POST['sessionId'];
    

    P.S. You really need to change the way you’re accessing your data. Access the data first, preferably using an external class, and then use the data in your rendered output. Don’t mix HTML and PHP data logic as if they’re best buds.

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

Sidebar

Related Questions

I have two php pages. Page 1 contains one form which i submitted with
I have got two pages. example.com/php.com and example.com. I use this function to set
I have two pages name one.php and two.php in one.php i have a combo
I have two pages like reg.php and profile.php. in reg.php have a field gender
I have two pages: one.php <?php if($_POST && $_POST['captcha'] == 'thisisrandom'){ echo 'KEY =
I have two pages, product.php and viewcart.php. When a user clicks on a button
I have 2 two php pages.One is the main and include the second and
I have two pages 1.php and 2.php 2.php (which is the secret page) can
I have two web pages which work basically the same, code-wise, but one of
I have two pages. One with the select boxes on and the send button.

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.