Re: how to use the same file...
| From: | Ignacio Vazquez-Abrams | Date: | Sat, 25 Nov 2000 21:22:58 +0000 |
| Subject: | Re: how to use the same file... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27181@lists.php.net to get a copy of this message | ||
On Sat, 25 Nov 2000, Christian Dechery wrote:
> How do I get PHP to build a form and process it in the same blabla.php???
>
> like... if you go to
> "http://www.somewhere.com/blabla.php"
>
> it would only show the form to fill up, and the form action would be
> "blabla.php"... it's that PHP_SELF stuff right?
> but how can I tell if there where no GET parameters... should I check
> QUERY_STRING or is there a better way of doing it?
> ____________________________
> . Christian Dechery (lemming)
> . http://www.tanamesa.com.br
> . Gaita-L Owner / Web Developer
>
In the form tag, simply omit an action and it will go to the same file.
In the PHP script, simply check (isset($HTTP_GET_VARS) and
count($HTTP_GET_VARS))
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>