Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

GETting or POSTing a form

Posted on 2003-11-24
3
Medium Priority
?
216 Views
Last Modified: 2006-11-17
How do I determine whether I am GETting from a form (i.e. first time called) or being POSTed from a form(the user caused a submit)?
0
Comment
Question by:AntonBotes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 6

Expert Comment

by:andreif
ID: 9814706
there are 2 global arrays $_GET and $_POST

if you looking for some field name, let's say 'submit' you may check which of $_GET['submit'] or $_POST['submit'] is defined
0
 
LVL 14

Accepted Solution

by:
ThG earned 150 total points
ID: 9814707
You mean from the client side or the server side?
from the server side it's trivial, just check the $_SERVER['REQUEST_METHOD'] variable..
it should be either GET or POST
0
 
LVL 1

Expert Comment

by:Snyke
ID: 9828604
PHP up to version 4.3.0 the arrays name was $HTTP_SERVER_VARS ... the rest is the same.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question