Question

OK i have this problem: I'm creating a search function and to do that correctly i have to pass the word that is written in search field to uri eg. third segment. But since Codeigniter only supports post and not get method (it can be enabled but I'm looking for way around) I need to pass that variable via post to uri. Can anybody help me?

Was it helpful?

Solution

POST to a controller then redirect to the page with the word in the URL.

search.php

$this->input->post('q') AND redirect('search/query/'.$this->input->post('q');

Tada.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top