You are here: Re: Hide URL parameters « PHP Programming Language « IT news, forums, messages
Re: Hide URL parameters

Posted by Peter van Schie on 11/03/05 10:41

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация