php $act,$act和$filename没定义成功,提示Notice: Undefined index:

还是不行,求解!!!<?php

header("Content-Type: text/html;charset=utf-8");

require_once 'dir.func.php';

require_once 'file.func.php';

require_once 'common.func.php';

$path = 'File';

$act = $_REQUEST['act'];

$filename = $_REQUEST['filename'];

$info = readDirectory($path);

$redirect = "index.php?path={$path}";

if ($act == "createFile") {

//创建文件

//echo $filename;

//echo $path."--";

$mes = createFile($path . "/" . $filename);

alterMes($mes, $redirect);

} elseif ($act == "showContent") {

$content = file_get_contents($filename);

//echo "{$content}";

if (strlen($content)) {

highlight_string($content);  //高亮显示字符串中的PHP代码

// 高亮显示文件中的PHP代码  highlight_file($content)

} else {

alterMes("文件没有内容,请编辑后再查看!", $redirect);

}

} elseif ($act == "editContent") {

//修改文件内容

//获取文件内容

$content = file_get_contents($filename);

$str = <<< EOF

{$content}

EOF;

echo $str;

} elseif ($act == "doEdit") {

//修改文件内容的操作

$content = $_REQUEST('content');

//echo $filename;exit;

echo $content;

if (file_put_contents($filename, $content)) {

$mes = "文件修改成功";

} else {

$mes = "文件修改失败";

}

alterMes($mes, $redirect);

} elseif ($act == "renameFile") {

//完成重命名

$str = <<

请填写新文件名:

EOF;

echo $str;

}elseif($act == "deRename"){

//实现重命名的操作

$newname = $_REQUEST['newname'];

renameFile($filename,$newname);

}

?>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值