有没有作业答案,参考一下
HTML页面
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>成绩</title></head><body><form action="cjpd.php" method="POST"> <input type="text" name="num1" value="在这里输入分数" onfocus="if (value=='在这里输入分数')value='' "> <input type="submit"value="提交"></form></body></html>
PHP页面
<meta charset="utf8"><?php$cj=$_POST['num1'];if(!is_numeric($cj) or $cj<0){echo '请正确输入分数';}else if($cj>=0 and $cj<60){echo '不及格';}else if ($cj>=60 and $cj<70){echo'及格了,要努力';}else if($cj>=70 and $cj<80){echo '还不错';}else if($cj>=80 and $cj<90){echo'上清华有希望';}else if($cj>=90 and $cj<100){echo'全村人的希望';}else if($cj==100){echo'太强了吧';}else if($cj>100){echo'惹不起,惹不起';}?>
html页面
<!doctype html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title></head><body><form action="reg.php"> 姓名:<input type="text" name = "username"></br> 密码:<input type="text" name = "password"></br> <input type="submit" value = "提交"></form></body></html>
PHP代码:
<?php $u = $_GET["username"]; echo $u;?>
点击html页面中的提交,想要运行PHP文件,但是结果是下载了PHP文件,想问一下怎么回事?
你可以把问题发出来,我们一起来参考一下
HTML页面
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>成绩</title>
</head>
<body>
<form action="cjpd.php" method="POST">
<input type="text" name="num1" value="在这里输入分数"
onfocus="if (value=='在这里输入分数')value='' ">
<input type="submit"value="提交">
</form>
</body>
</html>
PHP页面
<meta charset="utf8">
<?php
$cj=$_POST['num1'];
if(!is_numeric($cj) or $cj<0)
{echo '请正确输入分数';}
else if($cj>=0 and $cj<60)
{echo '不及格';}
else if ($cj>=60 and $cj<70)
{echo'及格了,要努力';}
else if($cj>=70 and $cj<80)
{echo '还不错';}
else if($cj>=80 and $cj<90)
{echo'上清华有希望';}
else if($cj>=90 and $cj<100)
{echo'全村人的希望';}
else if($cj==100)
{echo'太强了吧';}
else if($cj>100)
{echo'惹不起,惹不起';}
?>
html页面
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<form action="reg.php">
姓名:<input type="text" name = "username"></br>
密码:<input type="text" name = "password"></br>
<input type="submit" value = "提交">
</form>
</body>
</html>
PHP代码:
<?php
$u = $_GET["username"];
echo $u;
?>
点击html页面中的提交,想要运行PHP文件,但是结果是下载了PHP文件,想问一下怎么回事?
你可以把问题发出来,我们一起来参考一下