Solved

GETting or POSTing a form

Posted on 2003-11-24
3
208 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 50 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

732 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