user1471909
user1471909

Reputation: 11

how to change url with textbox value

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

Upvotes: 0

Views: 436

Answers (3)

Luke Pittman
Luke Pittman

Reputation: 843

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

EDIT: Linkie: URL Rewriting

Upvotes: 0

Anudeep GI
Anudeep GI

Reputation: 941

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

Upvotes: 0

WhoaItsAFactorial
WhoaItsAFactorial

Reputation: 3558

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.

Upvotes: 1

Related Questions