what are key differences between $_get and $_post
I searched a lot for differences between these both terms.
i am happy with others also but that is not a ending and final clue i find
so i am there to write it and comments are appreciated always !
First i would discuss pros and cons of both !
Benefits of $_get :
- It can be bookmarked
- $_Get is used for ajax request with xmlhttprequest,the more power !
- There would remains parameters in browser as per they are part of url when submitting
- Ascii charaters are allowed
- It is cacheable
- 7607 character maximum size
Disadvantages OF $_GET :
- Easier to hack
- Less secure
- Url length is restricted
- If password or secrets etc. are used with $_get ; they are prone to be hacked
Benefits of &_Post :
- Multipart/form-data or application /s-www-form-urlencoded use mutipart encoding for binary data
- It can send parameters
- It can inlude uploading files to the server
- It is less prone to be hacked
- No restrictions
- When submitted no variables etc are not shown
- 8mb max size can send or more also
Disadvantages of $_post :
- It is not cache-able
- It can not be bookmarked
- Parameters are saved in browser history
- Normally when refreshing the page , requires submit again as it is not cache-able
Now the question comes to mind that when we should $_get and when we should use $_post
they have their own values and we cannot claim this thing that one is preferable than other etc.
Here we should use a techniques one is called url rewriting for $_post and $_get and second is called url encoding for safe programming and development.
We should use these techniques for getting the best maximum results from both of them.
comments are appreciated always !