我想将值从一个页面传递到另一个页面。
<form action="../PHP/sendemail.php" enctype="multipart/form-data" method="post">
<table class="table" style="margin-bottom: 0">
<tbody>
<?php
while($row=mysqli_fetch_assoc($res)){
?>
<tr>
<td style="vertical-align: middle;">
<input type="text" id="email" name="email<?= $row['vacancyid'];?>" value='<?= $row['email'];?>'>
</td>
<td>
<input type="submit" class="btn btn-info btn-sm" value="Apply Now" id="btn<?= $row['vacancyid']?>" name="btn<?= $row['vacancyid']?>">
</td>
<tr>
<?php
}
?>
</tbody>
</table>
sendmail.php
<?php
$email2 = $_POST['email'];
?>
我想知道get name =“发送电子邮件到sendemail.php页面。 谢谢
答案 0 :(得分:0)
尝试将name用作数组:
<form action="../PHP/sendemail.php" enctype="multipart/form-data" method="post">
<table class="table" style="margin-bottom: 0">
<tbody>
<?php
while($row=mysqli_fetch_assoc($res)){
?>
<tr>
<td style="vertical-align: middle;">
<input type="text" id="email" name="email[]" value="<?= $row['email'];?>">
</td>
</tr>
<?php
}
?>
<tr>
<input type="submit" class="btn btn-info btn-sm" value="Apply Now" id="btn" name="btn">
</tr>
</tbody>
</table>
</form>
php文件:
<?php
$email = $_POST['email'];
print_r($email);
?>