If the page is simply viewed in the browser, the request method will be GET. If the form has been submitted, the request method will be POST. So we first make a decision whether to display the form if the request method is not POST, or to process the form data if the request method is POST. The first time the page is viewed, the request method will be GET, so the next thing we do is obtain a reference to the current page that we can use in a ECHO or PRINT command. That reference is stored in the variable $me: $me = $_SERVER['PHP_SELF']; Now, if the request method is not POST, we just exit PHP and let the form be displayed.
by
coohler
2008-11-24 17:17
php
·
forms