I have this apply page where i'm listing different jobs one can apply for each job has specific values and id, i'm listing all the values dynamically.
i'm printing the sql data inside an html table, now what i wanted to do was when i click on apply in want to process and send the job id to another page, but what is happening is same job id is being sent to the process page , regardless os which row's apply button i click on
1.apply.php
<?php
include("db.php");
session_start();
$result=mysqli_query($con,"SELECT * FROM news_upload order by id desc");
?>
<form action='process.php' method='post'>
<table class="table table-bordered">
<tr>
<th width="5%">Job ID</th>
<th width="13%">Apply</th>
<th width="10%">Date Uploaded</th>
<th width="33%">Job Title</th>
<th width="22%">Education</th>
<th width="10%">Salary</th>
<th width="12%">Location</th>
<th width="33%">Last Date of Apply</th>
</tr>
<tbody>
<?php
while($row=mysqli_fetch_array($result)){
echo "<tr>";
echo '<td><input type="text" name="name" value="'.$row['id'].'"></td>';
echo '<td> <input width="10px" id="view" type="submit" name="submit" value="Apply"></td>';
echo "<td>".$row['created_at']."</td>";
echo "<td>".$row['heading']."</td>";
echo "<td>".$row['education']."</td>";
echo "<td>".$row['salary_max']."</td>";
echo "<td>".$row['location']."</td>";
echo "<td>".$row['last_date']."</td>";
echo "</tr>";
}
?>
</tbody>
</form>
-
process.php
<?php session_start(); if (isset($_POST['name'])){ $name = $_POST['name']; echo $name; //echo("Selected Radio Button is".$button); } ?>