รายละเอียดของการตอบ ::
ค่า คอนฟิก นะครับ ไฟล์ system/application/config/config.php
Code (PHP)
$config['base_url'] = "http://localhost/codeigniter_test/ci/ci/";
$config['index_page'] = "index.php";
$config['uri_protocol'] = "AUTO";
$config['url_suffix'] = "";
$config['language'] = "english";
$config['enable_hooks'] = FALSE;
$config['subclass_prefix'] = 'MY_';
$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;
$config['log_path'] = '';
$config['log_date_format'] = 'Y-m-d H:i:s';
$config['cache_path'] = '';
$config['encryption_key'] = "";
$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;
$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
$config['compress_output'] = FALSE;
$config['time_reference'] = 'local';
$config['proxy_ips'] = '';
<a href="<?php echo site_url("about.php");?>">about as</a>
ผมเขียนอย่างนี้อะครับ พอเอาเม้าไปแต่ลิ้งมันโชว์ประมาณว่า
http://localhost/codeigniter_test/ci/ci/index.php/about.php
พอกด มันก็หาเพจไม่เจออะครับ
ถ้าเขียนอย่างนี้ ก็เกิด Erorr ครับ
<a href="<?php echo $base_url();?>about">About Page</a>
Erorr
Code
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: base_url
Filename: views/home.php
Line Number: 16
Fatal error: Function name must be a string in C:\AppServ\www\codeigniter_test\ci\ci\application\views\home.php on line 16
ไม่รู้ผมทำผิดตรงไหนรึเปล่าครับ