Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199807

[PHP3] [Fwd: [PHP3] How to find method (POST/GET)] From: Mike W. Otto (mikeqdai <email protected>)
Date: 07/12/98

Hello Morton,
 Im using this code:

/* get headers */
 
 $hc=0;
 $headers = getallheaders();
 while (list($header, $value) = each($headers))
         {
         $h[] = $header;
         $hv[]= $value;
         $hc++;
         }
 
 /* postmethod not available yet */
 
 $i=0;
 for ($i = 1;;$i++)
         {
                         if ($i >= $hc) {break;}
                         if ($h[$i] == "Content-length")
                         {
                         $error="on";
                         $alert="Please use the GET-Method.";
                         }
         }
 
 because I found out that the header variable "Content-length" is only
 send via POST-Method. Hope this is useful.
 
 - mike
 
 David Morton wrote:

> How does one find whether a page was accessed via GET or POST?
>
> On a side note, *almost* a rant...

> I'm sure this is easy for the veterans, but it sure is hard to
> find answers to simple qustions from the documentation.
> It's like the old runaround:
> "How do you spell xxxxxxxx?"
> "Look it up in a dictionary"

--
PHP 3 Mailing List   http://www.php.net/
To unsubscribe send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest list:  php3-digest-subscribe <email protected>
For help: php3-help <email protected>  Archive: http://www.tryc.on.ca/php3.html