Buttons, Forms, and Entry Boxes

Button with Java Script

We declare a JAVA procedure, which is invisible to the user, and call the script when the user presses "Calculate". The script refers to elements in a "form". The "button" is an "input" of type "button".

X: Y: kg Product:

PHP Forms

Our web server provides in-line PHP execution for text files with the ".php" extension. Invisible to you, but embedded in this file, are segments of PHP code that are executed by the server. The code directly below this paragraph in the PHP file checks to see if this page was loaded with a POST or a GET request, and reports accordingly.


NOT A POST REQUEST
GET REQUEST

The code below this paragraph in the PHP file sets the "post_string" and "get_string" variables.

Here is a form that generates a post request when we press the submit button. The string value is the current value of "post_string", which will be "UNDEFINED" when we load the page with a GET request, or with a POST that does not specify the variable "string".

Here is a form that generates a get request when we press the submit button. The string value is the current value of "get_string", which will be "UNDEFINED" when we load with a POST request, or with a GET that does not specify the variable "string".

Here are the GET, POST, and SERVER arrays after PHP receives the current request, generates the page, and transmits the pages back to the client.

$_GET Array:
Array
(
)
$_POST Array:
Array
(
)
$_SERVER Array:
Array
(
    [PATH] => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
    [PHP_WRAPPER_VERSION] => 560
    [SCRIPT_NAME] => /Temporary/Buttons.php
    [REQUEST_URI] => /Temporary/Buttons.php
    [QUERY_STRING] => 
    [REQUEST_METHOD] => GET
    [SERVER_PROTOCOL] => HTTP/1.0
    [GATEWAY_INTERFACE] => CGI/1.1
    [REMOTE_PORT] => 56174
    [SCRIPT_FILENAME] => /data/27/5/115/103/5767592/user/6872833/htdocs/Temporary/Buttons.php
    [SERVER_ADMIN] => [no address given]
    [CONTEXT_DOCUMENT_ROOT] => /data/27/5/115/103/5767592/user/6872833//.
    [CONTEXT_PREFIX] => /~5767592.6872833
    [REQUEST_SCHEME] => http
    [DOCUMENT_ROOT] => /usr/services/vux/apache/htdocs
    [REMOTE_ADDR] => 13.59.231.155
    [SERVER_PORT] => 80
    [SERVER_ADDR] => 10.30.72.19
    [SERVER_NAME] => bndhep.net
    [SERVER_SOFTWARE] => Apache
    [SERVER_SIGNATURE] => 
    [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
    [HTTP_ACCEPT] => */*
    [HTTP_CONNECTION] => close
    [HTTP_X_FORWARDED_PROTO] => http
    [HTTP_X_REAL_IP] => 10.30.83.30
    [HTTP_HOST] => bndhep.net
    [DOMAIN_USER] => 5767592.6872833
    [RAILS_URI] => INVAL
    [DOMAIN_NAME_REAL] => bndhep.net
    [PKEY] => 5767592.6872833
    [DOMAIN_PATH] => /data/27/5/115/103/5767592/user/6872833/htdocs
    [DOMAIN_NAME] => bndhep.net
    [SCRIPT_URI] => http://bndhep.net/Temporary/Buttons.php
    [SCRIPT_URL] => /Temporary/Buttons.php
    [FCGI_ROLE] => RESPONDER
    [PHP_SELF] => /Temporary/Buttons.php
    [REQUEST_TIME_FLOAT] => 1714816123.111
    [REQUEST_TIME] => 1714816123
    [argv] => Array
        (
        )

    [argc] => 0
)