PHP $_REQUEST Variable

Concepts 2008. 1. 21. 17:46

PHP에 $_REQUEST 변수가 있는데

이 변수는 $_GET, $_POST, $_COOKIE를 포함한다.

다음을 참고하기 바란다.



The PHP $_REQUEST variable contains the contents of both $_GET, $_POST, and $_COOKIE.

The PHP $_REQUEST variable can be used to get the result from form data sent with both the GET and POST methods.



Reference:
http://www.w3schools.com/php/php_get.asp

Posted by 알 수 없는 사용자
,

FORM 태그에서 사용할 수 있는 METHOD에는

GET Method와 POST Method가 있다.

GET Method는 URL에 FORM 태그 내의 정보를 포함시키는 방식이고,

POST Method는 HTTP Body 안에 포함시키는 방식이다.

GET Method는 얼핏봐도 좋아 보이지 않는다.

왜냐하면, 암호와 같이 민감한 데이터에 사용할 수 없을 뿐더러,

100 글자라는 길이 제한까지 있어 불편하다.

그렇다면, 왜 GET Method가 존재하는 것일까?

GET Method를 사용하면 해당 페이지를 Bookmark할 수 있기 때문이다.

다음을 참고하기 바란다.



Note: When using the $_GET variable all variable names and values are displayed in the URL. So this method should not be used when sending passwords or other sensitive information! However, because the variables are displayed in the URL, it is possible to bookmark the page. This can be useful in some cases.

Note: The HTTP GET method is not suitable on large variable values; the value cannot exceed 100 characters.



Reference:
http://www.w3schools.com/php/php_get.asp

Posted by 알 수 없는 사용자
,

PHP Form Validation

Tips 2008. 1. 21. 16:52

HTML 태그 내의 FORM 태그는 사용자 입력을 받는 부분이다.

이 부분은 사용자의 잘못된 입력의 가능성을 내포하고 있기 때문에

반드시 유효성을 검사해야만 한다.

유효성 검사는 두 곳에서 가능하다.

첫 째는 클라이언트에서 할 수 있고, 둘 째는 서버에서 할 수 있다.

클라이언트 측에서 하면 서버의 부하를 줄일 수 있고,

서버 측에서 하면 보안을 강화할 수 있다.

서버 측에서 유효성 검사를 할 때에는 같은 페이지에서 할 것을 권장한다.

다음 글을 참고하기 바란다.



User input should be validated whenever possible. Client side validation is faster, and will reduce server load.

However, any site that gets enough traffic to worry about server resources, may also need to worry about site security. You should always use server side validation if the form accesses a database.

A good way to validate a form on the server is to post the form to itself, instead of jumping to a different page. The user will then get the error messages on the same page as the form. This makes it easier to discover the error.



Reference:
http://www.w3schools.com/php/php_forms.asp

Posted by 알 수 없는 사용자
,