|
|
|
ขอสอบถามหน่อยครับคือว่าผมจะส่งค่า ID ไปที่ modal แต่พอคลิกแล้วไม่โชว์ข้อมูลคับ |
|
|
|
|
|
|
|
ขอความกรุณาหน่อยคับอ่านตามกระทู้ก็ยังไม่เข้าใจคับ
Code php
Code (PHP)
<?php require_once('Connections/Connect.php'); ?>
<?php
$maxRows_showarticle = 4;
$pageNum_showarticle = 0;
if (isset($_GET['pageNum_showarticle'])) {
$pageNum_showarticle = $_GET['pageNum_showarticle'];
}
$startRow_showarticle = $pageNum_showarticle * $maxRows_showarticle;
mysql_select_db($database_Connect, $Connect);
$query_showarticle = "SELECT * FROM articles WHERE a_type_id='1' ORDER BY a_id DESC";
$query_limit_showarticle = sprintf("%s LIMIT %d, %d", $query_showarticle, $startRow_showarticle, $maxRows_showarticle);
$showarticle = mysql_query($query_limit_showarticle, $Connect) or die(mysql_error());
$row_showarticle = mysql_fetch_assoc($showarticle);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- Main Stylesheet File -->
<link href="css/style.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<style type="text/css">
#articles {
width: 1200px;
float: left;
padding-left: 20px;
}
.articles {
width: 200px;
float: left;
height: 200px;
margin-top: 20px;
margin-right: 30px;
margin-bottom: 20px;
margin-left: 20px;
padding-top: 20px;
padding-right: 30px;
padding-bottom: 20px;
padding-left: 20px;
}
body,td,th {
font-family: Verdana, Geneva, sans-serif;
width: auto;
}
</style>
</head>
<body>
<div id="articles">
<?php do { ?>
<div class="articles"><img src="news\img\<?php echo $row_showarticle['img']; ?>" width="200" height="200" ></a><br/>
<a data-toggle = "modal" data-target="#news" data-id="<?php echo $row_showarticle['a_id']; ?>" >ข่าว : <?php echo $row_showarticle['title']; ?><img src="news/images/icon/icon_new.gif" width="50" height="30"></a><br/><br/><br/></div>
<?php } while ($row_showarticle = mysql_fetch_assoc($showarticle)); ?>
</div>
</div>
<div class="modal fade" id="news" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">รายละเอียด</h4><br/>
<div class="modal-body">
<div class="form-group">
<div class="articles"><img src="news\img\<?php echo $row_showarticle['img']; ?>" width="200" height="200" ><br/>
</div></div></div>
</div>
</div>
</div>
</div>
<?php
mysql_free_result($showarticle);
?>
</body>
</html>
Tag : PHP
|
|
|
|
|
|
Date :
2018-07-25 10:55:13 |
By :
HLEW |
View :
1018 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|