Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem getting variable from URL

Status
Not open for further replies.

knuckle05

Programmer
Dec 17, 2001
247
CA
Hi All,

I'm new here, and hoping someone can help me with what should be an easy one.

In my URL I have this:


from PHP I am trying to get the Transaction variable like so:

$TransAction = $_POST['TransAction'];

My FORM Method is set to POST as well.

Anyhow, my variable continues to be empty. Can someone tell me why?

Thx!!
 
If a variable is going into PHP on the URL, you will find it in $_GET, not $_POST.

If you have a form like:

<form method="POST" action="foo.php?bar=3">
<input type="text" name="baz">
<input type="submit">
</form>

Then you will be performing both POST- and GET-method input simultaneously. In foo.php, the value for "bar" will be found in $_GET (bar is input on the URL). The value for "baz" will be in $_POST (it came via POST-method form).

The two input methods are separate from each other and not mutually exclusive.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top