A search box (kind of) help...


#1

Ok, I have no clue where to even look / start on this so many one of you can help me :D

What I want is a search box, and say someone searches “dog” then they click the “submit” button, then they will automatically be redirected to “http://www.mydomain.com/dog

If they search “house” and click submit they will be directed to “http://www.mydomain.com/house

Do you get it? I have no clue how to start this =/


#2

Create a form for people to put in their selection then create the php script, it could be in the same file, but as for the processing portion, depending on what you chose for the form method, post or get (get would be good for a search) you would use either the $_POST[‘xxx’] or $_GET[‘xxx’] then you would you the php header function like so:

[php]
header(“Location: http://www.mydomain.com/”.$_GET[‘result’]);
[/php]

Be sure that what’s in the [ ]'s is the name you used for your form field. Make sure you DO NOT output to the browser before using the header() function or it will result in an error.