Welcome Guest, Not a member yet? Register   Sign In
Need help on URL and search
#1

[eluser]cbmeeks[/eluser]
I'm looking to run a small search engine on my site.

Anyway, I want the user to simply type some words in a search box and click submit. The action form is set to GET instead of POST.

This makes the URL look like:

example.com/search/q?search=amiga+computers

My problem is that I can't seem to get my function "q" that is in my "search" controller to grab the search string "amiga+computers".

I imagine it's because I don't have query strings enabled.

I would settle for something like:

example.com/search/q/amiga+computers

But how do I get my input html to send the data like that? Is URL routing my answer?

Thanks!
#2

[eluser]marcoss[/eluser]
In your config, enable query strings and set the default uri protocol to "PATH_INFO", like this:

Code:
$config['enable_query_strings'] = TRUE;
$config['uri_protocol']    = "PATH_INFO";

That way you can use both, segment based uri and query strings without "hacking" CI.
#3

[eluser]cbmeeks[/eluser]
You are my hero.

You CI guys rock. I will remember you all when I get rich for my web idea.

You see, I am writing a killer website that monitors the mood swing of cats while streaming the results to Twitter. I wear flip-flops and come into work at 2:30pm.

HAHAHA

Seriously, thanks again.

cbmeeks
#4

[eluser]marcoss[/eluser]
Ok, in that case I'll save this post to claim my 10% of the company once you go public Tongue
#5

[eluser]cbmeeks[/eluser]
lol.

I actually hope to release something this week. CI has literally made it a possibility to release version 0.001 of my "product" in a weekend's worth of time.

I will announce it on the forums later. It's nothing fancy. Just a simple search engine based on BOSS. More of an experiment than anything else.

cbmeeks




Theme © iAndrew 2016 - Forum software by © MyBB