0

I have a site, e.g., http://www.example.com/
I want to add a search box for searching the addresses etc. like " south dakota " and then click on submit button, and records will be fetch from database in php (Configured mySQL with select query) coded file. I want to show my result on http://www.example.com/south-dakota/ this url. So I want to change url with textbox value and related records will display on that page.

For example you can check this site findbankrates.com

4
  • So which part are you stuck on? Commented Jun 21, 2012 at 11:31
  • How can I do this?.... For example findbankrates.com you can check this.... after searching a Bank like bank of America... Commented Jun 21, 2012 at 11:35
  • @user1471909 : What if I search letter A and got so many results? so many pages should get opened? Commented Jun 21, 2012 at 11:44
  • @FahimParkar i am talking about url buddy if u search a then the url is findbankrates.com/banks/a Commented Jun 21, 2012 at 12:30

3 Answers 3

1

You could set the text field in an HTML form that uses a GET action. Then use a rewrite rule in your .htaccess file that turns www.xyz.com/search.php?string=south%20dakota to www.xyz.com/south%20dakota.

Sign up to request clarification or add additional context in comments.

Comments

0

redirect the url using header( 'Location: http://www.yoursite.com/'.variableformtextbox )

Comments

0

You'll want to look at mod_rewrite to do that... then simply submit the form to that url.

EDIT: Linkie: URL Rewriting

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.