嗨,大家好。关于变量传递我有问题。我无法清楚地解释它,但这是代码。我知道这会更清楚。
<tbody>
<tr>
<td><?php echo $row['nameSchool'] ?></td>
<td><?php echo $row['address'] ?></td>
<td><?php echo $row['honor'] ?></td>
<td><?php echo $row['year'] ?></td>
<td width = "5%"><div id='basic-modal-2'><a href="?idnum = <?php echo $row['countr']; ?>" title = "Edit" class = "basic"><img src="../img/edit.png" height="22" width="22"></a></div></td>
<td><a href="#" title = "Delete"><img src="../img/Delete.png" height="22" width="22"></a></td>
</tr>
<?php
}
?>
</tbody>
//some codes here.
<!-- Update Employee -->
<div id="basic-modal-content-2">
<h3>Update Information</h3>
<p></p>
</br>
<form method="post" action="add3.php">
<table id = "box-table-c2" class = "basic-modal-content-2">
<thead></thead>
<tbody>
<tr>
<td><strong><?php echo $_GET['idnum']; ?></strong></td>
<td>:</td>
<td><input type="text" class="input-xlarge" name = "NS"></td>
</tr>
<tr>
<td><strong>Address</strong></td>
<td>:</td>
<td><input type="text" class="input-xlarge" name = "ad"></td>
</tr>
<tr>
<td><strong>Honors Received</strong></td>
<td>:</td>
<td><input type="text" class="input-xlarge" name = "HR"></td>
</tr>
<tr>
<td><strong>Year Graduated</strong></td>
<td>:</td>
<td><input type="text" class="input-xlarge" name = "YG"></td>
</tr>
<tr>
<td align= "left" width= "3"><button class="btn-primary" type="submit" style = "cursor: pointer";>Submit</button></td>
</tr>
</tbody>
</table>
</form>
</div>
他们都在同一个php文件(educinfo.php)
我的错误是我无法将“编辑”链接的值传递给simplemodal。
谢谢你们。答案 0 :(得分:0)
您可以使用多种方式在PHP中传递值。一种方法是在Query String中传递值。也就是说,您可以在带有问号的文件名后传递值。就像键值传递一样
phpfilename.php?key1=value1&key2=value2
您可以传递任意数量的键和值。之后,您可以使用键值访问下一页。
在HTML部分中:
<a href="filename.php?QueryString=valueOne" title = "Edit" class = "basic">
<img src="../img/edit.png" height="22" width="22">
</a>
在php中你可以得到这样的
$Idvalue = isset($_GET['QueryString']) ? $_GET['QueryString'] : "";
如果你有任何传递价值的问题,请告诉我