A search box (kind of) help...


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 =/


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:

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

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.