改为?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>一元二次方程简单处理程序 [email protected]</title>
</head>
<!--BY [email protected] -->
<body>
<p>输入的格式为a(X*X)+bX+c:</p>
<form method="post" action="math.php">
<p>a=
<input type="yiyuanerci" maxlength=25 size=10 id="a" >
<br>
b=
<input type="yiyuanerci" maxlength=25 size=10 id="b" >
<br>
c=
<input type="yiyuanerci" maxlength=25 size=10 id="c" >
<br>
<input type="submit" name="submit" value="提交" >
<br>
</p>
<hr />
<span class="STYLE5">Copyright © <a href="http://blog.csdn.net/fallingleaf">fallingleaf</a> 2007 All rights Reserved</span></div>
</body>
</html>还是不行
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>一元二次方程简单处理程序 [email protected]</title>
</head>
<!--BY [email protected] -->
<body>
<p>输入的格式为a(X*X)+bX+c:</p>
<form method="post" action="math.php">
<p>a=
<input type="yiyuanerci" maxlength=25 size=10 id="a" >
<br>
b=
<input type="yiyuanerci" maxlength=25 size=10 id="b" >
<br>
c=
<input type="yiyuanerci" maxlength=25 size=10 id="c" >
<br>
<input type="submit" name="submit" value="提交" >
<br>
</p>
<hr />
<span class="STYLE5">Copyright © <a href="http://blog.csdn.net/fallingleaf">fallingleaf</a> 2007 All rights Reserved</span></div>
</body>
</html>还是不行
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>一元二次方程简单处理程序 [email protected]</title>
</head>
<!--BY [email protected] -->
<body>
<p>输入的格式为a(X*X)+bX+c:</p>
<form method="post" action="math.php">
<p>a=
<input type="text" maxlength=25 size=10 name="a" >
<br/>
b=
<input type="text" maxlength=25 size=10 name="b" >
<br/>
c=
<input type="text" maxlength=25 size=10 name="c" >
<br/>
<input type="submit" name="submit" value="提交" >
<br/>
</p>
</form>
<hr />
<span class="STYLE5">Copyright © <a href="http://blog.csdn.net/fallingleaf">fallingleaf</a> 2007 All rights Reserved</span></div>
</body>
</html>
<?
$first = $_POST["a"];//一定要大写
$second = $_POST["b"];
$third = $_POST["c"];
$d=$second*$second-4*$first*$third;
if($d>0)
{
$x1=(-$second+sqrt($d))/2*$first;
$x2=(-$second-sqrt($d))/2*$first;
echo "$x1";
echo "$x2";
}
elseif($d==0)
{
$x=(-$second+sqrt($d))/2*$first;
echo "$x";
}
else
{
echo "方程无实数根!";
}
?>
$second = $_post["b"];
$third = $_post["c"];
----------------
$first = $_POST['a'];
$second = $_POST['b'];
$third = $_POST['c'];
2、php的变量名是区分大小写的$_post和$_POST是不同的变量