 |
|
Code (PHP)
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("td[id='td']").click(function(){
var val=$(this).attr('src');
//alert(val);
$("#test1").val(val);
$("#test").submit();
});
});
</script>
</head>
<body>
<table width="1604" border="0">
<tr>
<td width="1598"><?php
if($_SERVER['REQUEST_METHOD'] === 'POST'){
$m = $_POST['m_id'];
$y = $_POST['y_id'];
}else{
$date = date("Y-m-d H:i:s");
$m = substr($date,5 ,2);
$y = substr($date,0 ,4);
}
//-----------------------------------function year-------------------------------//
function isLeapYear($y) {
$y = $y;
return ((($y % 4) == 0) && ((($y % 100) != 0) || (($y %400) == 0)));
}
//------------------------------------------------------------------------------//
$total = isLeapYear($y);
if(!$total){
$totalfeb = 28;
}else{
$totalfeb = 29;
}
//-------------------------------------check mount------------------------------//
$count = array(1, 3, 5, 7, 8, 10, 12);
if (in_array($m, $count)){
$totalday = 31;
}else{
$totalday = 30;
}
?>
<form action="page2.php" method="post" name="test" id="test">
<input id="test1" name="test1" type="hidden" value="">
</form>
ก่อนบรรทัด
<form action="page2.php" method="post" name="test" id="test">
<input id="test1" name="test1" type="hidden" value="">
</form>
จะเป็นตารางยาวมากเลยไม่ได้ใส่มาครับ
Tag : PHP, HTML/CSS, JavaScript
|
ประวัติการแก้ไข 2013-06-20 14:05:15 2013-06-20 14:09:46
|
 |
 |
 |
 |
Date :
2013-06-20 13:51:37 |
By :
tommejung |
View :
726 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |