Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3850390
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:00:07+00:00 2026-05-19T17:00:07+00:00

I have a form which submits to a search page. I can handle the

  • 0

I have a form which submits to a search page. I can handle the MOD_REWRITE stuff at the back end but want to know the best way to get the search result page in a nice format in the first place.

Is it best to receive the form submission, then redirect to a nicer url structure. In the following example the user searches for blah.

/search.html?searchterm=blah

Which redirects to

/search/blah/

Or can I (my preferred option) do this using javascript (or jQuery) somehow after the user clicks the submit button?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T17:00:07+00:00Added an answer on May 19, 2026 at 5:00 pm

    definitely you should read this tutorial:

    • http://matthewjamestaylor.com/blog/how-to-post-forms-to-clean-rewritten-urls

    basics:

    1. mysql_real_escape_string() searched term
    2. remove all non Alpha/Num chars
    3. place the + between each matched word
    4. SELECT MATCH AGAINST || IN BOLEAN MODE || LIKE

    mod_rewrite

    RewriteRule ^search/([^/\.]+)$ search.php?q=$1
    

    PS: the PHP part in the link is a little bit outofdate, so, for example you should use preg_replace instead of ereg_replace, and you can also avoid the extra step of stripping spaces by doing it all in the first try; you may also check for stopwords and refine your regex as suggested ex.: foo-bar. there are other things to consider but for a novice is a good starting point.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say we have a web page with a search input form, which submits
I have a page that contains an HTML form that submits back to itself
I have this form tag below where the form submits to itself which I
I need to have a checkbox which ajax-submits a form. The following code throws
I have a form which on submit I want to run a script via
I have a form which I want to submit upon button click which is
I have a search form with default values. As the user loades the page,
I have a form for searching products which will be visible in each page.
I have several forms inside DIVS on my page. I have one form which
I have a php page which has multiple form tags. each form is dealing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.