前台代码(部分):<fieldset style="float:left;width: 48%">
<label>设备年平均机时</label>
<input style="width: 88%" type="text" name="years_hour" id="years_hour">
</fieldset>
<fieldset style="float:left;width: 48%">
<label>额定课时数</label>
<input style="width: 88%" type="text" name="plan_hour" id="plan_hour">
</fieldset>
<fieldset style="float:left;width: 48%">
<label>学院专业数</label>
<input style="width: 88%" type="text" name="major_count" id="major_count">
</fieldset>
</div><br>
<div class="moudle_footer">
<div class="submit_link">
<input type="submit" value="提交" class="alt_btn" onclick="getcheckInfo()">
<input type="submit" value="返回" onclick="hidePopup()">
JS代码:function getcheckInfo(){
var years_hour = $('#years_hour').val();
var plan_hour = $('#plan_hour').val();
var major_count = $('#major_count').val();
$.post("../Mainfunc.php",{years_hour:years_hour,plan_hour:plan_hour,major_count:major_count},function(data){
alert(data)
});
}
后台文件代码:
$years_hour = $_post['years_hour'];
$plan_hour = $_post['plan_hour'];
$major_count = $_post['major_count'];
echo $years_hour; //测试用
结果就是 我用firebug 可以看到能将提交的值POST到后台,但是后台文件接收不到值 比如后台文件中的 $years_hour = $_post['years_hour'] 返回的值是空的 求大神看看,关键是后台文件是不是哪里错了
<label>设备年平均机时</label>
<input style="width: 88%" type="text" name="years_hour" id="years_hour">
</fieldset>
<fieldset style="float:left;width: 48%">
<label>额定课时数</label>
<input style="width: 88%" type="text" name="plan_hour" id="plan_hour">
</fieldset>
<fieldset style="float:left;width: 48%">
<label>学院专业数</label>
<input style="width: 88%" type="text" name="major_count" id="major_count">
</fieldset>
</div><br>
<div class="moudle_footer">
<div class="submit_link">
<input type="submit" value="提交" class="alt_btn" onclick="getcheckInfo()">
<input type="submit" value="返回" onclick="hidePopup()">
JS代码:function getcheckInfo(){
var years_hour = $('#years_hour').val();
var plan_hour = $('#plan_hour').val();
var major_count = $('#major_count').val();
$.post("../Mainfunc.php",{years_hour:years_hour,plan_hour:plan_hour,major_count:major_count},function(data){
alert(data)
});
}
后台文件代码:
$years_hour = $_post['years_hour'];
$plan_hour = $_post['plan_hour'];
$major_count = $_post['major_count'];
echo $years_hour; //测试用
结果就是 我用firebug 可以看到能将提交的值POST到后台,但是后台文件接收不到值 比如后台文件中的 $years_hour = $_post['years_hour'] 返回的值是空的 求大神看看,关键是后台文件是不是哪里错了