![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Tags: get and post, php |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |||
| GET and POST methods GET and POST methods Does anyone know exactly when to use the GET and when to use the POST methods, why and why not? Thanks in advance. ___________________ b&b Edinburgh Lighter Belt Buckle |
| |
| ||||
| GET is used for when the variables are in the URL. For example, http://www.programmerstalk.net/index...iable=my_value would give you $_GET['my_variable']. POST is used when data is submitted via a form through tags like <input type="text" name="my_variable" value="my_value" /> Then, you'd have $_POST['my_variable'] |
| |||
| Security reasons my also influence your choice between get and post $_GET, your variables from the form are passed through the URL, there are some security issues related to this as the user can bookmark this page. &_POST, less of a security risk because there is no URL passing your data from form to server, also the user can't bookmark the submitted page. I usauly use $_GET for testing purposes to see if the variable are passed through the URL, when variables are pass I change to $_POST. |
![]() |
| Thread Tools | |
| Display Modes | |
| |