Kod:
układ katalogów:
/application
->/controllers
->/models
->/views
->.htaccess
->config.ini
/library
->/Zend
->Zend.php
->.htaccess
index.php
.htaccess
katalog /FCKEditor jest 2 poziomy wyżej
index.php
<?php
set_include_path('.'.PATH_SEPARATOR
.'./library/'.PATH_SEPARATOR
.'./application/models/'.PATH_SEPARATOR
.'../../FCKeditor/'); include('Zend.php');
include('fckeditor.php');
define('FCKEDITOR', './library/FCKEditor');
function __autoload($class) { Zend::loadClass($class); }
$route = new Zend_Controller_RewriteRouter();
$controller = Zend_Controller_Front::getInstance();
$controller->setRouter($route);
$view = new Zend_View();
$view->setScriptPath('./application/views/');
Zend::register('view', $view);
$dbconfig = new Zend_Config(Zend_Config_Ini::load('./application/config.ini', 'database'));
Zend::register('dbconfig', $dbconfig);
$db = Zend_Db::factory($dbconfig->db->adapter, $dbconfig->db->config->asArray());
Zend_Db_Table::setDefaultAdapter($db);
Zend::register('db', $db);
Zend::register('post', new Zend_Filter_Input($_POST));
Zend::register('get', new Zend_Filter_Input($_GET));
$controller->run('./application/controllers/');
?>
indexController.php
<?php
class IndexController extends Zend_Controller_Action {
public function IndexAction() {
$view = Zend::registry('view');
echo $view->render('site.tpl.php'); }
public function __call($action, $arguments) {
$this->_redirect('http://localhost/zendfcke/');
}
public function noRouteAction() {
$this->_redirect('http://localhost/zendfcke/');
}
}
?>
site.tpl.php
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
</head>
<body>
<form action='zendfcke/index/save' method="post">
<?php
$fckeditor = new FCKeditor('content');
$fckeditor->BasePath = FCKEDITOR;
$fckeditor->Width = '600';
$fckeditor->Height = '600';
$fckeditor->Create();
?>
</form>
</body>
</html>
.htaccess w katalogu głównym
<?php
RewriteEngine on
RewriteRule .* index.php
?>
.htaccess w katalogu /application
<?php
deny from all
?>
.htaccess w katalogu /library
<?php
deny from all
?>
po zmianie serwera zamiast
Cytat
Zamiast utwrzenia okna edytora, obok uruchamiany jest widok z którego próbowałem uruchomic fckeditora.
teraz jest komunikat
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
Dzięki za pomoc