
PHP错误提示怎么解决
Notice:Useofundefinedconstantroot-assumed'root'inC:\Ftp\Users\guanli2\Webroot\test.ph...
Notice: Use of undefined constant root - assumed 'root' in C:\Ftp\Users\guanli2\Webroot\test.php on line 83
<?php
$value=$_POST['select'];
$name=$_POST['name'];
$passwd=$_POST['passwd'];
require_once 'config.php'; //引入配置文件
$db=mysql_connect($db_host,$db_user,$db_password);
mysql_select_db("message",$db);
$result=mysql_query("select * from student",$db);
$row=mysql_fetch_array($result);
....
if ($name==root and $passwd==root and $value==3)
{
header ("location: select2.html");
exit;
}
else {
//header ("location: index.html");
} 展开
<?php
$value=$_POST['select'];
$name=$_POST['name'];
$passwd=$_POST['passwd'];
require_once 'config.php'; //引入配置文件
$db=mysql_connect($db_host,$db_user,$db_password);
mysql_select_db("message",$db);
$result=mysql_query("select * from student",$db);
$row=mysql_fetch_array($result);
....
if ($name==root and $passwd==root and $value==3)
{
header ("location: select2.html");
exit;
}
else {
//header ("location: index.html");
} 展开
展开全部
字符串应该加引号,否则php会抛出一个notice
改为 $name==“root” and $passwd==“root” and $value==3
当然,你可以error_reporting(E_WARNING);来关闭这个这个提示
改为 $name==“root” and $passwd==“root” and $value==3
当然,你可以error_reporting(E_WARNING);来关闭这个这个提示
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
error_reporting(0);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
if ($name==root and $passwd==root and $value==3)
root加上引号试试
root加上引号试试
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询