【发布时间】:2015-11-20 08:12:56
【问题描述】:
我正在开发一个应用程序。我得到了网址和结果 http://localhost/mydss/result/search
当我使用关键字“radha”进行查询时,得到的结果很好。
但是,当我输入 URL http://localhost/mydss/result/search/radha 时,我没有得到任何结果。
参数应该如何传递给URL?
home.php
<form action="<?php echo site_url('result/search');?>" method = "post" name="search" id="search">
<section class="s_form">
<input type="search" placeholder="Search..." id="search" name="search" autocomplete="off" value="">
<button type="submit" class="btn search_button gray"><span class="i_search_g"> </span></button></form>
Result.php
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Result extends CI_Controller {
function __construct()
{
parent::__construct();
$this->load->model('result_model','',TRUE);
}
function search()
{
$keyword = $this->input->get_post('search', TRUE);
$data['keyword'] = $keyword;
$data['results'] = $this->result_model->search($keyword);
$this->load->view('result',$data);
}}
【问题讨论】:
-
你的问题完全没有意义..
-
@Svetlio 这个问题的解决方案是什么??
-
问题是什么?你有 url > 你想要 url .. 你没有显示任何代码.. 如果你有第一个 url 工作,第二个应该也可以工作.. 但是你的问题是荒谬的,没有显示你的代码中的任何内容..
-
@Svetlio 我正在添加代码。请给我解决方案
标签: php codeigniter url resultset