Form Variables.. a question for experienced coders

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
romeo
Forum Contributor
Posts: 138
Joined: Sun Apr 21, 2002 12:50 pm

Form Variables.. a question for experienced coders

Post by romeo »

I have heard of programs that read an html form

<form action=order.php>
<input type hidden name=stuff= value=Svalues>
</form>

And display it in the order it was written and pathed to the processor... like a direct link

this for have an output of

order.php?stuff=Svalues


Anyone have a clue what this program or terminolgy is>?
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Code: Select all

<form action="order" name="orderform" method="get">
<input type="hidden" name="stuff" value="svalues">
<input type="text" name="amount">
<input type="submit" name="submitbutton" value="Send">
</form>
will send you to order.php?stuff=svalues&amount=what you entered


but what do you want this for?
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Not entirely sure what you're question is.

You can of course view source in a browser to see hidden vars. If you were to pass these to the processor as you have described, you'd be passing them as $_GET vars - but normally form processors expect the form to use the "post" action (not always, although they should) so they will be looking for $_POST vars.

Of course with register globals on (which ideally it shouldn't be) the processor may not attempt to access either of the $_GET or $_POST superglobal arrays and so won't distinguish between vars passed via either method.
Post Reply