By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,721 Members | 1,206 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,721 IT Pros & Developers. It's quick & easy.

Hide URL parameters

P: n/a
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.
Nov 3 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Thu, 03 Nov 2005 08:10:30 +0200, Big Time
<bi**************************@hotmail.com> wrote:
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 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.
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.


--
---
Exact Meta Search | Major Search Engine
http://exactsearcher.com
Nov 3 '05 #2

P: n/a
Big Time wrote:
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.


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.
--
http://www.phpforums.nl
Nov 3 '05 #3

P: n/a
Big Time wrote:
I understand you can hide the parameters by using the POST method,


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
Nov 3 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.