Php I';我犯了禁止的错误
我有一个board_directors.php页面,Php I';我犯了禁止的错误,php,mysql,Php,Mysql,我有一个board_directors.php页面, 当我从管理面板更新我的页面时,它会显示出来 被禁止的 您没有在此服务器上访问/new/admin/board_directors.php的权限。 此外,尝试使用ErrorDocument处理请求时遇到404 Not Found错误 这里有6个表单字段和2个文本区域字段 我的代码是: if(isset($_REQUEST['submitted']) && $_GET['edit'] == "yes"){ $id
当我从管理面板更新我的页面时,它会显示出来 被禁止的 您没有在此服务器上访问/new/admin/board_directors.php的权限。 此外,尝试使用ErrorDocument处理请求时遇到404 Not Found错误 这里有6个表单字段和2个文本区域字段 我的代码是:
if(isset($_REQUEST['submitted']) && $_GET['edit'] == "yes"){
$id = $_GET['id'];
$yes = $_GET['edit'];
$dir_sl = $_POST['dir_sl'];
$dir_name = $_POST['dir_name'];
$dir_position = $_POST['dir_position'];
$dir_email = $_POST['dir_email'];
$dir_mobile = $_POST['dir_mobile'];
$dir_details = $_POST['dir_details'];
$file2 = $_FILES['file']['name'];
if(!empty($file2)){
$file = $_FILES['file']['name'];
// Uploade Image Directory start
$add="board_directors_images/".$_FILES['file']['name']; // the path with the file name where the file will be stored, upload is the directory name.
//echo $add;
if(move_uploaded_file ($_FILES['file']['tmp_name'],$add)){
//echo "Successfully uploaded the image";
chmod("$add",0777);
}
///////// Start the thumbnail generation//////////////
$n_width=100; // Fix the width of the thumb nail images
$n_height=140; // Fix the height of the thumb nail imaage
////////////////////////////////////////////
$tsrc="board_directors_images/thumb/".$_FILES['file']['name']; // Path where thumb nail image will be stored
/////////////////////////////////////////////// Starting of png thumb nail creation///////////
if (@$_FILES['file']['type']=="image/png")
{
$im=ImageCreateFrompng($add);
$width=ImageSx($im); // Original picture width is stored
$height=ImageSy($im); // Original picture height is stored
$n_height=($n_width/$width) * $height; // Add this line to maintain aspect ratio
$newimage=imagecreatetruecolor($n_width,$n_height);
imageCopyResized($newimage,$im,0,0,0,0,$n_width,$n_height,$width,$height);
if (function_exists("imagepng")) {
Header("Content-type: image/png");
Imagepng($newimage,$tsrc);
}
elseif (function_exists("imagejpeg")) {
Header("Content-type: image/jpeg");
ImageJPEG($newimage,$tsrc);
}
chmod("$tsrc",0777);
}////////// end of png file thumb nail creation//////////
////////////// starting of JPG thumb nail creation//////////
if($_FILES['file']['type']=="image/jpeg"){
$im=ImageCreateFromJPEG($add);
$width=ImageSx($im); // Original picture width is stored
$height=ImageSy($im); // Original picture height is stored
$n_height=($n_width/$width) * $height; // Add this line to maintain aspect ratio
$newimage=imagecreatetruecolor($n_width,$n_height);
imageCopyResized($newimage,$im,0,0,0,0,$n_width,$n_height,$width,$height);
ImageJpeg($newimage,$tsrc);
//chmod("$tsrc",0777);
}
} else {
$sql1 = "SELECT * FROM tbl_board_directors WHERE fld_id =' ".$_GET['id']."' limit 1";
$result1 = mysql_query($sql1);
$test = mysql_fetch_array($result1);
$file = $test['fld_pic'];
$file = $file;
}
// End upload image direcotory
$sql = mysql_query("update tbl_board_directors set fld_sl_no = '".$dir_sl."', fld_name = '".$dir_name."', fld_post = '".$dir_position."', fld_email = '".$dir_email."', fld_mobile = '".$dir_mobile."', fld_details = '".$dir_details."', fld_pic = '".$file."' where fld_id = '".$id."' ");
if($sql){
//echo "<strong style='color:green; font-size:14px;'>Board of directors Updated!</strong>";
header("Location: board_directors.php?id=".$id."&edit=".$yes."&confirm=Content Updated!");
}
}
if(isset($\u请求['submitted'])&&&$\u获取['edit']=“yes”){
$id=$_GET['id'];
$yes=$_GET['edit'];
$dir_sl=$_POST['dir_sl'];
$dir\u name=$\u POST['dir\u name'];
$dir_position=$_POST['dir_position'];
$dir_email=$_POST['dir_email'];
$dir\u mobile=$\u POST['dir\u mobile'];
$dir_details=$_POST['dir_details'];
$file2=$_文件['file']['name'];
如果(!empty($file2)){
$file=$_文件['file']['name'];
//上载映像目录启动
$add=“board_directors_images/”$_FILES['file']['name'];//存储文件的文件名路径,upload是目录名。
//echo$add;
如果(移动上传的文件($文件['file']['tmp\u名称],$add)){
//echo“成功上传图像”;
chmod(“$add”,0777);
}
/////////开始生成缩略图//////////////
$n_width=100;//固定拇指指甲图像的宽度
$n_height=140;//固定拇指指甲图像的高度
////////////////////////////////////////////
$tsrc=“董事会董事会图像/thumb/”$\u文件['file']['name'];//存储拇指指甲图像的路径
///////////////////////////////////////////////开始创建png拇指指甲///////////
如果(@$_FILES['file']['type']==“image/png”)
{
$im=ImageCreateFrompng($add);
$width=ImageSx($im);//存储原始图片宽度
$height=ImageSy($im);//存储原始图片高度
$n_height=($n_width/$width)*$height;//添加此行以保持纵横比
$newimage=ImageCreateTureColor($n\u宽度,$n\u高度);
imageCopyResized($newimage,$im,0,0,0,0,$n_-width,$n_-height,$width,$height);
如果(函数_存在(“imagepng”)){
标题(“内容类型:图像/png”);
Imagepng($newimage,$tsrc);
}
elseif(函数_存在(“imagejpeg”)){
标题(“内容类型:图像/jpeg”);
ImageJPEG($newimage,$tsrc);
}
chmod(“$tsrc”,0777);
}//////////png文件拇指指甲创建结束//////////
//////////////开始创建JPG拇指指甲//////////
如果($_FILES['file']['type']==“image/jpeg”){
$im=ImageCreateFromJPEG($add);
$width=ImageSx($im);//存储原始图片宽度
$height=ImageSy($im);//存储原始图片高度
$n_height=($n_width/$width)*$height;//添加此行以保持纵横比
$newimage=ImageCreateTureColor($n\u宽度,$n\u高度);
imageCopyResized($newimage,$im,0,0,0,0,$n_-width,$n_-height,$width,$height);
ImageJpeg($newimage,$tsrc);
//chmod(“$tsrc”,0777);
}
}否则{
$sql1=“从董事会中选择*,其中fld\U id=”。$\U GET['id']。“'limit 1”;
$result1=mysql\u查询($sql1);
$test=mysql\u fetch\u数组($result1);
$file=$test['fld_pic'];
$file=$file;
}
//结束上传图像目录
$sql=mysql\u query(“更新tbl\u董事会董事设置fld\u sl\u no=”、$dir\u sl.”、fld\u name=“$dir\u name.”、fld\u post=”、“$dir\u position.”、fld\u email=“$dir\u email.”、fld\u mobile=“$dir\u mobile.”、fld\u details=”、“$dir\u details.”、fld\u pic=“$file.”、其中fld\u id=”、“$id=”;
如果($sql){
//echo“