Cytat
Ya I agree with devbro on how to do it but I would set a flashdata session instead of a regular session then just reset it when they go to the next page. that way if they leave the search pages they don’t have any unnecessary session data.
Atleast that how I do it.
Identycznie u mnie reaguje na sesje...
Niby problem rozwiązałem:
function search()
{
$this->load->library('pagination');
$this->load->model('cytat');
$tekst['artysci'] = $this->cytat->get_artists();
$tekst['users'] = $this->cytat->get_users();
if($this->input->post('search') == 'yes')
{
$newsite = site_url().$this->uri->uri_string().'/'.$this->input->post('phrase');
redirect ($newsite, 'location');
}
if($this->uri->segment(3) != '')
{
$config['base_url'] = site_url().'/cytaty/search/'.$this->uri->segment(3).'';
$config['total_rows'] = $this->cytat->getSResults_num($this->uri->segment(3));
$config['per_page'] = '4';
$config['uri_segment'] = '4';
$config['full_tag_open'] = '<p align = "center">';
$config['full_tag_close'] = '</p>';
$config['next_link'] = 'Dalej';
$config['prev_link'] = 'Wstecz';
$this->pagination->initialize($config);
if(!$this->uri->segment(4))
$lol = 0;
else
$lol = $this->uri->segment(4);
$tekst['dane'] = $this->cytat->getSResults($this->uri->segment(3), $config['per_page'], $lol);
}
$this->load->view('bzdety', $tekst);
}
Co zrobiłem? Ano, odebrałem, to po user wpisał w pole, stworzyłem z tą frazą, nowy url, i przekierowałem na niego..
Widzicie jakieś zagrożenie dla takiego rozwiązania?1. Problem z polskimi znakami - próbowałem przez base64 lecz nie działało - nie upoważnione znaki - po przeszukaniu Internetu, pogrzebałem trochę w uri.php i teraz mam linki w postaci np
http://localhost/~cyt/index.php/cytaty/search/miłość - co ciekawe, polskie znaki w adresie działają
Jakie inne zagrożenia widzicie?