php传值
我是php初学者,怎么实现这两个页面的传值???
1.php
2.php
$_POST[username]=$username; //获取提交的变量值
$_POST[grade]=$grade;
if($Submit == "提交"){
echo "玩家" . $_POST[username] . "
";
echo "成绩" . $_POST[grade] . "
";
if($grade>70)
echo "你赢了!";
if($grade if($grade>88){echo "恭喜你!";}
else{
echo "下次努力!";
}
if($grade echo "你太差了!";
elseif($grade>70 && $grade echo "水平一般!";
elseif($grade>88 && $grade echo "技术很好啊!";
else
echo "技术很好!";
}
?>
------解决方案--------------------
你弄反掉了,不是
$_POST[username]=$username; //获取提交的变量值
$_POST[grade]=$grade;
而是
$username = $_POST[username];
$grade = $_POST[grade];
$_POST是个特殊数组,提交的数据都放在里面,不要对它进行赋值
------解决方案--------------------