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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.