所以我试图在我的程序中使用模态,见下文:
<?php
mysql_select_db($database_dbcon, $dbcon);
$query_igp = "SELECT SUM(price) AS prices, event_id FROM igp_payable WHERE event_id='".$row_events['event_id']."'";
$igp = mysql_query($query_igp, $dbcon) or die(mysql_error());
$row_igp = mysql_fetch_assoc($igp);
$totalRows_igp = mysql_num_rows($igp);
?>
<td><?php echo "₱ ". number_format($row_igp['prices'])?></td>
<td><?php if ($row_events["event_status"]== "Active"){?>
<span class="label label-success"><?php echo $row_events['event_status']; ?></span>
<?php } else {?>
<span class="label label-danger"><?php echo $row_events['event_status']; ?></span> <?php }?>
</td>
<td><?php if ($row_events["event_status"]== "Inactive"){?>
<a href="event_set_status.php?event_id=<?php echo $row_events['event_id']; ?>">Set as Active</a>
<?php } else {?>
<a href="" data-toggle="modal" data-target="#myModal">Set as Inactive</a> <?php }?>
<!-- | <a href="#">Edit</a>-->
</td>
</tr>
<?php } while ($row_events = mysql_fetch_assoc($events)); ?>
</tbody>
<tr>
<!--<td colspan="5"><a href="#">Add Event</a></td>-->
</tr>
</table>
</div><!--col-lg-12-->
</div><!-- /.row -->
<div class="col-lg-6">
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Closing the "<?php echo $row_events["event_name"]; ?>"</h4>
</div>
<div class="modal-body">
Closing the selected event may remove the linked account titles.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">Cancel</button>
<a href="event_set_status.php?event_id=<?php echo $row_events["event_id"];?>" class="btn btn-primary btn-sm">Close and Save</a>
<button type="button" class="btn btn-primary btn-sm">Save Only</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
问题出在我点击<a href="event_set_status.php?event_id=<?php echo $row_events['event_id']; ?>" class="btn btn-primary btn-sm">Close and Save</a>
时
回显的值为null,输出为: event_set_status.php?event_id =?
任何建议,这是我第一次使用模态。
我更新了我的代码,你们可以看到整个代码甚至我的查询。表部分工作正常,问题仅在模态部分