SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    846
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Can forms make use of mod_rewrite?

    I have a simple search form that, when submitted, shows the following URL:

    http://www.oil-testimonials.com/newV...hp?t=1&q=liver

    When I would like it to display like this:

    http://www.oil-testimonials.com/newV...herapy/1/liver

    I can do this when creating links on my site, but not sure how to change the following form:


    <form action='aromatherapy.php' method=GET>

    <input name=t type=hidden id='t' value='8' />
    <input name=q type=text size=27 maxlength=35 />
    <input class='button medium green' type=submit value='Go' />

    </form>


    Thanks!
    Convert your dollars into silver coins. www.convert2silver.com

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,607
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    bb,

    No a form can't make use of mod_rewrite - but that's not the real question in your mind.

    What you meant to ask was a means to reformat the link displayed when submitting the form.

    What I would do is simply use method="POST" rather than your method="GET". That would conceal the query string you're concerned with.

    What you're really asking is whether you can use mod_rewrite to make a "loopy redirection." That answer is yes but I'll merely refer you to the tutorial linked in my signature as there are a couple of ways to do this in the sample code section. If you're not making use of reference material posted here, answering these questions constitutes "spoon feeding." Read then ask questions, if you please.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •