Hide URL parameters

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Big Time

    Hide URL parameters

    I have a search form used to query a MySQL database. I want the search
    results to appear on the same page as the search form, below the search box
    after the have entered their search criteria. I can do this using the GET
    method, however this displayrs all the parameters in the URL. I understand
    you can hide the parameters by using the POST method, however what I'm not
    understanding is how I can display the results on the same page. If I use
    the POST method, it takes the user to a new page which I don't want. How do
    you hide the URL parameters for a form, while displaying the results on the
    same page? Is there a quick and easy way to just hide the URL parameters?

    Thanks for your help.


  • Berimor

    #2
    Re: Hide URL parameters

    On Thu, 03 Nov 2005 08:10:30 +0200, Big Time
    <bigtimegrizz-remove-for-spam@hotmail.co m> wrote:
    [color=blue]
    > I have a search form used to query a MySQL database. I want the search
    > results to appear on the same page as the search form, below the search
    > box
    > after the have entered their search criteria. I can do this using the
    > GET
    > method, however this displayrs all the parameters in the URL. I
    > understand
    > you can hide the parameters by using the POST method, however what I'm
    > not
    > understanding is how I can display the results on the same page. If I
    > use
    > the POST method, it takes the user to a new page which I don't want.[/color]

    How it takes to a new page? Which one? Who wrote this page - script by
    itself?
    Youre sending data to the same script, it reads its and decided what to
    display..
    Think there is a bug in script, check it.
    [color=blue]
    > How do
    > you hide the URL parameters for a form, while displaying the results on
    > the
    > same page? Is there a quick and easy way to just hide the URL
    > parameters?
    >
    > Thanks for your help.
    >
    >[/color]



    --
    ---
    Exact Meta Search | Major Search Engine

    Comment

    • Peter van Schie

      #3
      Re: Hide URL parameters

      Big Time wrote:[color=blue]
      > I have a search form used to query a MySQL database. I want the search
      > results to appear on the same page as the search form, below the search box
      > after the have entered their search criteria. I can do this using the GET
      > method, however this displayrs all the parameters in the URL. I understand
      > you can hide the parameters by using the POST method, however what I'm not
      > understanding is how I can display the results on the same page. If I use
      > the POST method, it takes the user to a new page which I don't want.[/color]

      Hi Big Time,

      Why would it take the user to a new page? It can take the user to the
      same page as well:

      <form name="search" action="<?php echo $_SERVER['PHP_SELF'];" method="POST">
      Search for: <input type="text" name="keyword">
      <br />
      <input type="submit" value="Search">
      </form>

      Then at the top of your searchscript, say something like:

      if ($_SERVER['REQUEST_METHOD '] == "POST")
      {
      // insert your search code here, using the data in $_POST
      }

      HTH.
      Peter.
      --

      Comment

      • John Dunlop

        #4
        Re: Hide URL parameters

        Big Time wrote:
        [color=blue]
        > I understand you can hide the parameters by using the POST method,[/color]

        put this to yourself: is 'hiding the parameters' sufficient grounds for
        switching to the POST method? i.e. does it outweigh your reasons, if you
        had any, for choosing GET in the first place?

        --
        Jock

        Comment

        Working...