well, in a nutshell: POST and GET are two methods HTTP uses to transmit variables. take this example, in plain HTML:
Code:
<form method="post"><input type="hidden" name="foo" value="bar" /></form>
what you're doing is creating a variable named
foo with a value of
bar. of course, this variable could be a text field, or a radio group, or whatever; in that case, the value would be whatever the user set it to.
when you submit that form, be it to the same script or another, the web server creates an array of variables and passes them along as well. php's $_POST array accesses these variables and allows you to use them.
the difference between POST and GET is that post variables are hidden from the user; they're passed invisibly, behind the scenes. if you created a form that used the GET method, the variables would be passed in the URL. it might look something like this:
forums.macrumors.com/newreply.php?do=newreply&p=756803
where we're passing several variables to a script named newreply.php. the first variable is
do, which has a value of
newreply; this, presumeably, tells the script what kind of action we're taking. (new reply, as opposed to editing your last reply or something.)
the second variable is
p, which i'm guessing in this case tells the script which thread we're replying to.
the critical difference between POST and GET is that POST varables, like i said, are passed behind the scenes. GET vars, on the other hand, can be spoofed. if you took our URL from above and changed that last string of digits, you might end up replying to some other thread.
now, in terms of php: if you have register_globals off, and you pass some variables to another script, you need to access those variables through the proper php arrays. that's because your new script doesn't know that these variables exist yet. in VERY broad strokes, that's what register_globals does: when on, it tells your scripts that there are a bunch of variables available to it. when off, it hides those variables until you access them in th proper way.
if i have a form that passes a variable
foo, with value
bar, to myscript.php, i have to extract
foo before i can work with it -- it doesn't just automatically get declared.
if my form uses the POST method, i can get
foo through the POST array: $_POST["foo"]. if i used the GET method, then i'd extract it with $_GET["foo"]. but if i just said "echo $foo;" it would be null. that's because my script doesn't know about the value i passed to $foo until i
tell it.
i hope that makes sense; i know it's a pretty abridged explanation. please, ask questions if you got 'em...