不对啊?出现这样的的错误“Directory Listing Denied This Virtual Directory does not allow contents to be listed.” <? require ('config.php');//require ('config.php'); //联接数据库 require ('sessionconfig.php') //关于session的检验 $id=$_GET[id]; $action=$_GET[action]; $referer=$_SERVER['HTTP_REFERER']; switch ($action){ case "showno": showno(); break; case "showyes": showyes(); break; default: header("Location:$referer"); break;} function showno(){ global $conn; $sql="UPDATE `article` SET `ifshow` = '0' WHERE `id` = '$id' LIMIT 1;" ; mysql_query($sql,$conn) or die("操作失败:".mysql_error()); header("Location:$referer");
} function showyes(){ global $conn; $sql="UPDATE `article` SET `ifshow` = '1' WHERE `id` = '$id' LIMIT 1;" ; mysql_query($sql,$conn) or die("操作失败:".mysql_error()); header("Location:$referer");
} ?>
网上查了下,Directory Listing Denied This Virtual Directory does not allow contents to be listed 错误原因是: 您站点的目录上没有找到首页文件
1:可能是require ('config.php')里没有连接上;
2:是不是在程序的某部分有运行mysql_close($yourlink);
3:或者最后一次使用的连接是别的数据库;
他明显是变量$conn的作用域问题嘛
This Virtual Directory does not allow contents to be listed.”
<?
require ('config.php');//require ('config.php'); //联接数据库
require ('sessionconfig.php') //关于session的检验
$id=$_GET[id];
$action=$_GET[action];
$referer=$_SERVER['HTTP_REFERER'];
switch ($action){
case "showno":
showno();
break;
case "showyes":
showyes();
break;
default:
header("Location:$referer");
break;}
function showno(){
global $conn;
$sql="UPDATE `article` SET `ifshow` = '0' WHERE `id` = '$id' LIMIT 1;" ;
mysql_query($sql,$conn) or die("操作失败:".mysql_error());
header("Location:$referer");
}
function showyes(){
global $conn;
$sql="UPDATE `article` SET `ifshow` = '1' WHERE `id` = '$id' LIMIT 1;" ;
mysql_query($sql,$conn) or die("操作失败:".mysql_error());
header("Location:$referer");
}
?>
This Virtual Directory does not allow contents to be listed
错误原因是:
您站点的目录上没有找到首页文件