html table 中未定义的 href
Undefined href in a html table
php 代码中的 html table 有问题。
我尝试了这段代码,但标签中的 href 有问题。事实上,当我点击 href 时,它 post 未定义,而 DetailsAnnonces.php 存在。
感谢您的回复。
<?php
$conn=@mysqli_connect($_SESSION['servername'],$_SESSION['username'],
$_SESSION['password'], $_SESSION['database']) or die(mysql_error());
$verifExistence1 = "SELECT * FROM `annonces`;";
$result = mysqli_query($conn, $verifExistence1);
echo "<table border = 2>";
echo "<table align='center'> <thead>
<tr>
<th>Titre</th>
<th>Description</th>
<th>Image</th>
</tr>
</thead>
<tbody>";
while($row = @mysqli_fetch_assoc($result)){
$idbis=$row['id'];
$titrebis=$row['titre'];
echo "<tr>
<td>" . $row['titre'] . "</td><td>" . $row['description'] . "</td>
<td> <a href=\"DetailsAnnonces.php?id=$idbis\">$titrebis</a>
</tr>";
}
echo "</table>";
//echo $html_table;
?>
问题出在 $idbis
<?php
echo "
<td>
<a href='DetailsAnnonces.php?id=".$idbis.">'".$titrebis."</a>
</td>
</tr>";
?>
此问题是由此页面上留下的 javascript 引起的。
php 代码中的 html table 有问题。 我尝试了这段代码,但标签中的 href 有问题。事实上,当我点击 href 时,它 post 未定义,而 DetailsAnnonces.php 存在。
感谢您的回复。
<?php
$conn=@mysqli_connect($_SESSION['servername'],$_SESSION['username'],
$_SESSION['password'], $_SESSION['database']) or die(mysql_error());
$verifExistence1 = "SELECT * FROM `annonces`;";
$result = mysqli_query($conn, $verifExistence1);
echo "<table border = 2>";
echo "<table align='center'> <thead>
<tr>
<th>Titre</th>
<th>Description</th>
<th>Image</th>
</tr>
</thead>
<tbody>";
while($row = @mysqli_fetch_assoc($result)){
$idbis=$row['id'];
$titrebis=$row['titre'];
echo "<tr>
<td>" . $row['titre'] . "</td><td>" . $row['description'] . "</td>
<td> <a href=\"DetailsAnnonces.php?id=$idbis\">$titrebis</a>
</tr>";
}
echo "</table>";
//echo $html_table;
?>
问题出在 $idbis
<?php
echo "
<td>
<a href='DetailsAnnonces.php?id=".$idbis.">'".$titrebis."</a>
</td>
</tr>";
?>
此问题是由此页面上留下的 javascript 引起的。