我的网址:
https://*.*/editor.php?path=public_html&file=index.php
editor.php 文件是:
<?php
if ( isset ( $_POST [ 'plain' ] ) ) {
print 'ok';
} else {}
$text = file_get_contents ( 'ftp://.../' . $_GET [ 'path' ] . '/' . $_GET [ 'file' ] );
?>
<form method="post"><textarea name="plain"><?php print $text; ?></textarea><input type="submit"></form>
如果没有提交,所以 $_POST 为空,那么它可以工作。如果提交发生,那么它不起作用,错误是:
Forbidden
You don't have permission to access this resource.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
问题是什么?
我尝试按如下方式更改文件的权限:
~/public_html/ftp - 0755
~/public_html/ftp/editor.php - 0644 change to 0777
~/public_html - 0755
~/public_html/index.php - 0644 change to 0777
这没用。