PHP统计结果

博主是一名新手,在尝试实现从text1.html选择内容后,通过POST方式在text_res.php页面进行统计并展示结果。目前遇到运行问题,寻求帮助。
摘要由CSDN通过智能技术生成

想实现在text1.html中选择,然后在text_res.php进行结果统计,并显示出来。小白一个,运行不了,有大神帮忙看下吗?

text1.html代码

<!doctype html>
<html>
<head>
<title>测试1</title>
<script>
function goFunction(){
        window.location.href="text_res.php";
    }	
	</script>

</head>
<body>
<form name="text" action="text_res.php" method="post">
<h1>测试1</h1>

<p>1、我觉得闷闷不乐,情绪低沉<br>	
	 <label><input name="sds1" type="radio" value="1">①没有或很少时间</label><br>
	 <label><input name="sds1" type="radio" value="2">②小部分时间</label><br>
	 <label><input name="sds1" type="radio" value="3">③相当多时间</label><br>
	 <label><input name="sds1" type="radio" value="4">④绝大部分或全部时间</label><br></p>
<p>*2、我觉得一天之中早晨最好<br>	
	 <label><input name="sds2" type="radio" value="1">①没有或很少时间</label><br>
	 <label><input name="sds2" type="radio" value="2">②小部分时间</label><br>
	 <label><input name="sds2" type="radio" value="3">③相当多时间</label><br>
	 <label><input name="sds2" type="radio" value="4">④绝大部分或全部时间</label><br></p>
<p>3、我一阵阵哭出来或觉得想哭<br>	
	 <label><input name="sds3" type="radio" value="1">①没有或很少时间</label><br>
	 <label><input name="sds3" type="radio" value="2">②小部分时间</label><br>
	 <label><input name="sds3" type="radio" value="3">③相当多时间</label><br>
	 <label><input name="sds3" type="radio" value="4">④绝大部分或全部时间</label><br></p>

<p><input name="tijiao" type="submit" value="已选好,看看结论!" onclick="goFunction()">
</form>	
</body>
</html>

text_res.php代码

<?php
$count0=$_POST['sds1'];
$count1=$_POST['sds1']+$_POST['sds2'];
$count2=$_POST['sds1']+$_POST['sds2']+$_POST['sds3'];

<html>
<head>
<title>结论1</title>
</head>
<body>
<h1>测试1</h1>

echo "一项和为:$count0";
echo "二项和为:$count1";
echo "三项和为:$count2";	
</body>
</html>

?>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值