用户
 找回密码
 入住 CI 中国社区
搜索
查看: 8191|回复: 16
收起左侧

[已解决] scafoldding中的add无法调用

[复制链接]
发表于 2009-1-20 07:11:37 | 显示全部楼层 |阅读模式
跟Derek Jones视频学做blog
用到scafoldding.
链接http://localhost/CodeIgniter/index.php/blog/scaffolding/显示正常。(如附件1)
点击Create New Record以后显示“无法找到该页”。

怎么回事?
PS:框架程序没有进行改动。
sca1.gif
sca2.gif
发表于 2009-1-20 10:59:03 | 显示全部楼层
看看到底转到什么地址了?
 楼主| 发表于 2009-1-20 13:01:08 | 显示全部楼层
转到http://localhost/CodeIgniter/index.php/blog/scaffolding/add
发表于 2009-1-20 13:11:56 | 显示全部楼层
你这个地址没问题呀,换个浏览器试试?
 楼主| 发表于 2009-1-20 15:17:53 | 显示全部楼层
myie, chrome, firefox都试过了,全是无法找到文件。
经检查,程序目录没问题。
我下的是1.7.0版本的。
sca3.gif
sca4.gif
sca5.gif
 楼主| 发表于 2009-1-20 15:20:04 | 显示全部楼层

autoload.php

PHP复制代码
 
 
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| AUTO-LOADER
| -------------------------------------------------------------------
| This file specifies which systems should be loaded by default.
|
| In order to keep the framework as light-weight as possible only the
| absolute minimal resources are loaded by default. For example,
| the database is not connected to automatically since no assumption
| is made regarding whether you intend to use it.  This file lets
| you globally define which systems you would like loaded with every
| request.
|
| -------------------------------------------------------------------
| Instructions
| -------------------------------------------------------------------
|
| These are the things you can load automatically:
|
| 1. Libraries
| 2. Helper files
| 3. Plugins
| 4. Custom config files
| 5. Language files
| 6. Models
|
*/

 
/*
| -------------------------------------------------------------------
|  Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in the system/libraries folder
| or in your system/application/libraries folder.
|
| Prototype:
|
|       $autoload['libraries'] = array('database', 'session', 'xmlrpc');
*/

 
$autoload['libraries'] = array('database');
 
 
/*
| -------------------------------------------------------------------
|  Auto-load Helper Files
| -------------------------------------------------------------------
| Prototype:
|
|       $autoload['helper'] = array('url', 'file');
*/

 
$autoload['helper'] = array();
 
 
/*
| -------------------------------------------------------------------
|  Auto-load Plugins
| -------------------------------------------------------------------
| Prototype:
|
|       $autoload['plugin'] = array('captcha', 'js_calendar');
*/

 
$autoload['plugin'] = array();
 
 
/*
| -------------------------------------------------------------------
|  Auto-load Config files
| -------------------------------------------------------------------
| Prototype:
|
|       $autoload['config'] = array('config1', 'config2');
|
| NOTE: This item is intended for use ONLY if you have created custom
| config files.  Otherwise, leave it blank.
|
*/

 
$autoload['config'] = array();
 
 
/*
| -------------------------------------------------------------------
|  Auto-load Language files
| -------------------------------------------------------------------
| Prototype:
|
|       $autoload['language'] = array('lang1', 'lang2');
|
| NOTE: Do not include the "_lang" part of your file.  For example
| "codeigniter_lang.php" would be referenced as array('codeigniter');
|
*/

 
$autoload['language'] = array();
 
 
/*
| -------------------------------------------------------------------
|  Auto-load Models
| -------------------------------------------------------------------
| Prototype:
|
|       $autoload['model'] = array('model1', 'model2');
|
*/

 
$autoload['model'] = array();
 
 
/*
| -------------------------------------------------------------------
|  Auto-load Core Libraries
| -------------------------------------------------------------------
|
| DEPRECATED:  Use $autoload['libraries'] above instead.
|
*/

// $autoload['core'] = array();
 
 
 
/* End of file autoload.php */
/* Location: ./system/application/config/autoload.php */
 
复制代码

[ 本帖最后由 oksnail 于 2009-1-20 15:23 编辑 ]
 楼主| 发表于 2009-1-20 15:22:14 | 显示全部楼层

config.php

PHP复制代码
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
$config['index_page'] = "index.php";
 
$config['uri_protocol'] = "AUTO";
 
 
$config['url_suffix'] = "";
 
$config['language']     = "english";
 
$config['charset'] = "UTF-8";
 
$config['enable_hooks'] = FALSE;
 
 
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
 
 
$config['enable_query_strings'] = FALSE;
$config['controller_trigger']   = 'c';
$config['function_trigger']     = 'm';
$config['directory_trigger']    = 'd'; // experimental not currently in use
 
$config['log_threshold'] = 0;
 
/*
|--------------------------------------------------------------------------
| Error Logging Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| system/logs/ folder.  Use a full server path with trailing slash.
|
*/

$config['log_path'] = '';
 
/*
|--------------------------------------------------------------------------
| Date Format for Logs
|--------------------------------------------------------------------------
|
| Each item that is logged has an associated date. You can use PHP date
| codes to set your own date formatting
|
*/

$config['log_date_format'] = 'Y-m-d H:i:s';
 
/*
|--------------------------------------------------------------------------
| Cache Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| system/cache/ folder.  Use a full server path with trailing slash.
|
*/

$config['cache_path'] = '';
 
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| If you use the Encryption class or the Sessions class with encryption
| enabled you MUST set an encryption key.  See the user guide for info.
|
*/

$config['encryption_key'] = "";
 
/*
|--------------------------------------------------------------------------
| Session Variables
|--------------------------------------------------------------------------
|
| 'session_cookie_name' = the name you want for the cookie
| 'encrypt_sess_cookie' = TRUE/FALSE (boolean).  Whether to encrypt the cookie
| 'session_expiration'  = the number of SECONDS you want the session to last.
|  by default sessions last 7200 seconds (two hours).  Set to zero for no expiration.
| 'time_to_update'              = how many seconds between CI refreshing Session Information
|
*/

$config['sess_cookie_name']             = 'ci_session';
$config['sess_expiration']              = 7200;
$config['sess_encrypt_cookie']  = FALSE;
$config['sess_use_database']    = FALSE;
$config['sess_table_name']              = 'ci_sessions';
$config['sess_match_ip']                = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update']  = 300;
 
/*
|--------------------------------------------------------------------------
| Cookie Related Variables
|--------------------------------------------------------------------------
|
| 'cookie_prefix' = Set a prefix if you need to avoid collisions
| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
| 'cookie_path'   =  Typically will be a forward slash
|
*/

$config['cookie_prefix']        = "";
$config['cookie_domain']        = "";
$config['cookie_path']          = "/";
 
/*
|--------------------------------------------------------------------------
| Global XSS Filtering
|--------------------------------------------------------------------------
|
| Determines whether the XSS filter is always active when GET, POST or
| COOKIE data is encountered
|
*/

$config['global_xss_filtering'] = FALSE;
 
/*
|--------------------------------------------------------------------------
| Output Compression
|--------------------------------------------------------------------------
|
| Enables Gzip output compression for faster page loads.  When enabled,
| the output class will test whether your server supports Gzip.
| Even if it does, however, not all browsers support compression
| so enable only if you are reasonably sure your visitors can handle it.
|
| VERY IMPORTANT:  If you are getting a blank page when compression is enabled it
| means you are prematurely outputting something to your browser. It could
| even be a line of whitespace at the end of one of your scripts.  For
| compression to work, nothing can be sent before the output buffer is called
| by the output class.  Do not "echo" any values with compression enabled.
|
*/

$config['compress_output'] = FALSE;
 
/*
|--------------------------------------------------------------------------
| Master Time Reference
|--------------------------------------------------------------------------
|
| Options are "local" or "gmt".  This pref tells the system whether to use
| your server's local time as the master "now" reference, or convert it to
| GMT.  See the "date helper" page of the user guide for information
| regarding date handling.
|
*/

$config['time_reference'] = 'local';
 
 
/*
|--------------------------------------------------------------------------
| Rewrite PHP Short Tags
|--------------------------------------------------------------------------
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files.  Options are TRUE or FALSE (boolean)
|
*/

$config['rewrite_short_tags'] = FALSE;
 
 
 
/* End of file config.php */
/* Location: ./system/application/config/config.php */
复制代码
 楼主| 发表于 2009-1-20 15:24:32 | 显示全部楼层

database.php

PHP复制代码
 
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the "Database Connection"
| page of the User Guide.
|
| -------------------------------------------------------------------
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
|        ['hostname'] The hostname of your database server.
|        ['username'] The username used to connect to the database
|        ['password'] The password used to connect to the database
|        ['database'] The name of the database you want to connect to
|        ['dbdriver'] The database type. ie: mysql.  Currently supported:
                                 mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
|        ['dbprefix'] You can add an optional prefix, which will be added
|                                 to the table name when using the  Active Record class
|        ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
|        ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
|        ['cache_on'] TRUE/FALSE - Enables/disables query caching
|        ['cachedir'] The path to the folder where cache files should be stored
|        ['char_set'] The character set used in communicating with the database
|        ['dbcollat'] The character collation used in communicating with the database
|
| The $active_group variable lets you choose which connection group to
| make active.  By default there is only one group (the "default" group).
|
| The $active_record variables lets you determine whether or not to load
| the active record class
*/

 
$active_group = "default";
$active_record = TRUE;
 
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "vertrigo";
$db['default']['database'] = "mysql";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
 
 
/* End of file database.php */
/* Location: ./system/application/config/database.php */
 
 
复制代码
 楼主| 发表于 2009-1-20 15:26:29 | 显示全部楼层
只修改过这三个文件。
其余的都没动过。
我用的是winxp, 文件和文件夹权限都没问题。
我的apache应该没有问题,访问其他php程序都可以。
发表于 2009-1-20 21:19:57 | 显示全部楼层
config.php文件中怎么少个$config('base_url')配置

本版积分规则