0
我需要創建這樣一個URL:www.example.com/index.php/scheda/name-surname-id.html笨 - URI段
所以我創建Scheda控制器,這是代碼:
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class Scheda extends CI_Controller{
function __construct(){
parent::__construct();
}
function index(){
$name_scheda = $this->uri->segment(2);
//i need only the id for the search into db
$id = substr($name_scheda, strripos($name_scheda,'-')+1, strlen($name_scheda));
echo "name:".$id;
}
}
,但是當我在地址欄寫的網址我得到一個404 error
...有人可以幫助我瞭解爲什麼?
那正是我需要的,非常感謝你的人! – 2012-01-03 17:56:42