Jump to content

What to use for post/get data


gevans

Recommended Posts

Hey guys,

 

Just saw a thread that got me thinking,

 

Whenever I need to get data sent with either GET or POST I always use $_REQUEST['foo'] on the other end.

 

I understand that $_POST['foo'] is for POST data, $_GET['foo'] is for GET data and $_REQUEST encompasses POST, GET, COOKIES. But is there any reason to not use $_REQUEST?

Link to comment
https://forums.phpfreaks.com/topic/133319-what-to-use-for-postget-data/
Share on other sites

I see what you're saying, I tend to comment everything that I'm pulling into my script, so that's not really a problem.

Isn't that just a lot more effort? If you wrote your code so it was more self-documenting, you would need so many comments. Comments should be used to explain the program in general, large parts of it or any oddities in the code.

 

As for any other reasons - not really. There's certainly no added security issues; all of the methods of input can be faked by the user, so it makes no difference. It's more to do with personal preference.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.