View Single Post
Old 02-05-2013, 01:24 AM   PM User | #6
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,462
Thanks: 0
Thanked 499 Times in 491 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Quote:
Originally Posted by countrydj View Post
I must admit, I don't really know when to use POST and when to use GET.
Is there a rule of thumb ???.
When the data is passed in a querystring (that is after a ? as part of a web address) then you read it using $_GET.

If the data is being passed from a form that has method="POST" then you read it using $_POST.

Note that in both cases you should validate the content received looks reasonable before moving it to another field for subsequent processing by your code - preferably validation but at least sanitize the data before moving it. That way you keep the tainted fields separated from the untainted ones.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Users who have thanked felgall for this post:
countrydj (02-05-2013)