求助php脚本递交问题
求助谁对PHP递交表单熟,帮忙看看谢谢<script language="javascript">
var time_start = new Date();
var clock_start = time_start.getTime();
function get_time_spent (){
var time_now = new Date();
return((time_now.getTime() - clock_start)/1000);
}
function show_secs (){
var i_total_secs = Math.round(get_time_spent());
var t;
document.fm0.time_class.value = mins(i_total_secs);
document.fm0.time_class0.value = i_total_secs;
var secs=document.fm0.time_class0.value;
t = window.setTimeout('show_secs()',1000);
if (document.fm0.time_class0.value >= parseInt(time_class.value)*60)
{
window.clearTimeout(t);
firm();
}
}
function mins(i_total_secs){
var i_secs_spent = i_total_secs % 60;
var i_mins_spent = Math.round((i_total_secs-30)/60);
var s_secs_spent = "" + ((i_secs_spent>9) ? i_secs_spent : "0" + i_secs_spent);
var s_mins_spent ="" + ((i_mins_spent>9) ? i_mins_spent : "0" + i_mins_spent);
return s_mins_spent + ":" + s_secs_spent;
}
function firm1() {
if (confirm("您完成了 "+Math.round((fm0.time_class0.value-30)/60)+" 分钟学时,确定要退出吗?")) {
document.cookie = "class_time="+window.btoa(Math.round((fm0.time_class0.value-30)/60));
document.cookie = "class_id="+window.btoa(document.fm0.class_id.value);
location.href="user_class_ck.php";
}
else {
return;
}
}
</script>
<form name="fm0">
<input type="text" name="time_class" size="4" disabled=""><input type="hidden" name="time_class0"><input type="hidden" name="class_id" value="3"><input type="hidden" id="user_id" name="user_id" value="333">
</form>
最后的递交time_class0=3560&class_id=3&user_id=333出错
你php代码呢?你这不就html和js吗 你这也没提交啊,你的post或者get的action在哪里?
location.href="user_class_ck.php"; 这句起不到提交的效果啊. 506874511 发表于 2022-8-28 09:02
你php代码呢?你这不就html和js吗
是的 就是html和JS kid2man 发表于 2022-8-28 10:05
你这也没提交啊,你的post或者get的action在哪里?
location.href="user_class_ck.php"; 这句起不到提交 ...
点退出<input type="button" value="退出">
后就是引用了function firm1() {
if (confirm("您完成了 "+Math.round((fm0.time_class0.value-30)/60)+" 分钟学时,确定要退出吗?")) {
document.cookie = "class_time="+window.btoa(Math.round((fm0.time_class0.value-30)/60));
document.cookie = "class_id="+window.btoa(document.fm0.class_id.value);
location.href="user_class_ck.php";
}
else {
return;
}
}
这段 function firm1() {
if (confirm("您完成了 " + Math.round((fm0.time_class0.value - 30) / 60) + " 分钟学时,确定要退出吗?")) {
document.cookie = "class_time=" + window.btoa(Math.round((fm0.time_class0.value - 30) / 60));
document.cookie = "class_id=" + window.btoa(document.fm0.class_id.value);
document.getElementById('fm0').submit()
//location.href = "user_class_ck.php";
} else {
return;
}
}
<form name="fm0" id="fm0" action="user_class_ck.php" method="get">
<input type="text" name="time_class" size="4" disabled="">
<input type="hidden" name="time_class0">
<input type="hidden" name="class_id" value="3">
<input type="hidden" id="user_id" name="user_id" value="333">
</form> cube 发表于 2022-8-29 14:53
function firm1() {
if (confirm("您完成了 " + Math.round((fm0.time_cla ...
user_class.php?class_num=9484c241ae942157be22ab6e7819d7c6&time_class0=3560&class_id=1&user_id=880提交是出错的
页:
[1]