Jump to content

GET or POST


shivani.shm

Recommended Posts

There is no 'better' or 'worse', they simply do different things at different times.

 

With get, all variables that are typed into form fields will appear in the URL on the next page. That means that if you have sensitive information, it will be seen. There is also a limit to the number of characters that can be in a URL, so if you have too much information in your form, they wont all fit in get. However, if you have a form and you want people to be able to link to the results, then get is the way to go.

 

With post, the information wont be visible in the URL, so its (a little) more secret. It can also handle a lot more data than GET. However, people wont be able to link to the results of post searches.

Link to comment
https://forums.phpfreaks.com/topic/96099-get-or-post/#findComment-491947
Share on other sites

What about $_SESSION? $_GET should only be used when it helps navigation. Like a profile. You use the Get option to extract the id number and output the correct profile. Use Post almost always. $_SESSION should be used be used for data held within a session or a user visit.

 

Hope that helps!

Link to comment
https://forums.phpfreaks.com/topic/96099-get-or-post/#findComment-492919
Share on other sites

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.