【发布时间】:2017-01-03 06:06:49
【问题描述】:
我正在尝试获取 php 中的字段值,但我似乎无法获取它们。尝试了post和get,没有结果。我知道这应该是一个简单的解决方案,但我看不到错误。任何帮助表示赞赏。谢谢!
这是我的报告.html:
<HTML>
<HEAD>
<meta charset="utf-8">
<link rel="stylesheet" href="css/style2.css">
<TITLE>SAE Report</TITLE>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$(function() {
$(".datepicker").datepicker({dateFormat:'yy-mm-dd'});
});
</script>
</HEAD>
<BODY>
<center>
<h1>SAE Report</h1>
</center>
<form action = "report.php" method = "get">
<label>Report Type</label>
<select id="report">
<option value="none"></option>
<option value="new">New SAEs Report</option>
<option value="cumulative">Cumulative SAE Report</option>
</select>
<label>Start Date</label><input type="text" class="datepicker" id='start' >
<label>End Date</label><input type="text" class="datepicker" id='end'>
<input type="submit" value="Submit" id ="submit">
</form>
</BODY>
这是我的report.php:
<?php
$report=$_GET['report'];
if ($report=="new"){
$start=$_GET['start'];
$end=$_GET['end'];
echo 'Start date is:'.$start.' and end date is: '.$end;
}
else if ($report=="cumulative"){
echo "print all SAEs";
}
?>
【问题讨论】:
标签: javascript php html datepicker get