Forum Moderators: coopster

Message Too Old, No Replies

Using the GET and POST form methods correctly

How do I use them?

         

megajam02

1:42 am on Aug 6, 2004 (gmt 0)

10+ Year Member



Ok,
You guys have been so helpful so far, so I'm gonna ask another newbie question.

I have a form that I want customers to fill out and submit. Based on the answers to the questions, the results page will display dynamic results.

My first instinct was to use the GET method, and append the answers to a URL, and have the results page look for the parameters. After doing some research, it appears that the POST method is cleaner and safer, however, it is not as intuitive for me.

My question is this. When using the POST method, how do I get my results page to see the post value. I know how to configure the if statement to display the appropriate result, but I don't know how to get the result page to recognize and read the POST values.

Can someone help?

Thanks,
Chris

megajam02

1:52 am on Aug 6, 2004 (gmt 0)

10+ Year Member



Ok. Is this it? Do I just simply need to use

$_POST['name']

to get the value?

megajam02

2:11 am on Aug 6, 2004 (gmt 0)

10+ Year Member



Never mind guys. I figured it out. Should have done some more homework before posting.

Thanks though.

ergophobe

4:37 pm on Aug 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




it appears that the POST method is cleaner and safer

Cleaner. Yes it will give you a shorter URL, but it will give you more complicated source code. It will also prevent users from bookmarking pages that depend on post data. For example, if you have page.php?profile_id=7, that can be bookmarked.

Safer. Marginally. People can inject post data fairly easily. If you need safety, you need far more security than the minimal obfuscation provided by post.

Tom