December 2001
Intermediate to advanced
480 pages
9h 22m
English
In the role of a confirmation tool, JavaScript can check the content of forms before data is sent to a PHP script. Such a role is important for real-world forms because, if troublesome data are sent to a PHP script, the wrong data could end up in your database.
PHP recognizes data from an HTML form element using the same naming structure, but with the added dollar sign before the variable name. For example, if a form element is named this:
alpha in an HTML page, it will be recognized as this in a PHP script:
$alpha To see one role of JavaScript in gathering in information, these next two scripts, one an HTML page and the other a PHP script, show how data can originate in
JavaScript and be passed to PHP. ...
Read now
Unlock full access