Welcome Guest, Not a member yet? Register   Sign In
A Case for _GET variables
#11

[eluser]Colin Williams[/eluser]
I'm not sure what makes generating query string links easier than segmented ones. In fact, all of CI's url functions expect segments, so I would think that would be the path of least resistance

Here's how I'd see the search function looking

Code:
function search()
{
    // Do search if there was a form submitted
    if (count($_POST))
    {
        $uri = '';
        $this->input->xss_clean($_POST);
        foreach($_POST as $key => $val)
        {
            $uri .= "$key/$val/";
        }
        redirect('browser/search/'. $uri);
    }
    
    // Do a search and load a view
    $this->load->model('vehicle');
    $data['result'] = $this->vehicle->get($this->uri->uri_to_assoc());
    $this->load->view('auto_search', $data);
}

There is obviously some more logic to it, but the basic idea is there
#12

[eluser]jedd[/eluser]
Colin - I'm very happy with the way things work with CI - but I'll defer to your opinion and expertise on this question. I've seen a few posts over time that suggest there's an SEO-related benefit to the 'query string' approach. I don't understand how this can be the case, but I'd be curious on your take.
#13

[eluser]Colin Williams[/eluser]
Yeah, jedd, there is a slight benefit in certain cases (used to be an detriment, actually, when search engines were "query string blind"). But it's a case of looking at SEO minutiae and giving it too much weight. The way Google indexes and weighs results could change tomorrow. If you are serious about a SEO campaign, you'll put your efforts into keyword saturation and pagerank.
#14

[eluser]octover[/eluser]
Colin that certainly was the direction I was/am going to go if I do it that way. (including capturing a form post and redirecting it). In fact I see a way that it is indeed the more elegant solution, in that I am doing less logic and processing before passing things off to the model.
#15

[eluser]Colin Williams[/eluser]
Cool. Good luck on the rest of your project.




Theme © iAndrew 2016 - Forum software by © MyBB