Web Hosting Talk







View Full Version : Appending a URL


cbths1
11-21-2006, 11:42 AM
Hello,

I am in need of a solution to appending a URL that would address 2 issues.

I want to setup a text box and a submit button on a page that when text is entered into the box and the submit button is clicked, the contents of the tex box are appended to the end of a URL and the user is directed to that page.

Example: the url would be somthing like this

http://www.example.com/path/to/file.aspx?id=1111&category=

And if a user entered the word "Books" into the text box and clicked the submit button the user would be directed to this URL - http://www.example.com/path/to/file.aspx?id=1111&category=Books.

Also, in the event the user didn't enter anything into the box, or enter text that didn't match a category, I need to redirect them back to the page with the text box and submit button or to a custom error page.

I am sure I could explain this better if I was a little more experienced but I'm not.

Any help would be greatly appreciated.

Thanks.

localhost127
11-21-2006, 03:02 PM
Switch your form method to GET, and name the text box "category" and you are done.

cbths1
11-21-2006, 03:41 PM
Great!

Thanks for the help.