改为?
<!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>还是不行
解决方案 »
- 关于GET传参放入数组的问题?
- htmlentities()函数设置GB2312后也显示并非汉字,而是空白
- PHP调用JS函数
- 一个apache URL重写的问题,几个小时了,都没有解决
- 如何用php做一个投票作弊的程序?
- linux下能否调用com组件?
- php安装问题,大家帮帮忙啊!
- PHP+MYSQL数据查询问题
- 我觉得我们PHP板块应该自己弄些好的工具或者教程之类,有意者入
- 大难题----------------------怎样配置 win2000+php+apache ,怎样让他们可以显示.gif 谢谢大家。我一定给分。
- 很菜的问题:怎样使用pdflib库
- 发送邮件需要什么组件吗?本地不行传到空间就可以发
<!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是不同的变量