|
|||||
|
PHP pages can handle input from forms and URL query strings almost transparently. Simply prepend a $ symbol to the name of the variable passed to the PHP page. For a GET method example, if you retrieve a page with the following URL:
then you can use the following code to print the variable to the screen:
The exact same code works for data submitted with a POST form. Unlike strongly-typed languages like Java and C++, PHP does not require explicit type definitions of variables. Therefore, the same variable containing numerical can be printed as text and also used in mathematical calculations with no need for conversions. if - then - else statements PHP also supports if - then - else constructs to create more sophisticated programs which return different results depending on user input. For example, the following script prints one of three lines of text depending on the value of the "variable" passed to it when the page is requested.
ote: MMA technical support staff cannot provide troubleshooting of problems with third-party CGI scripts including but not limited to: Perl scripts, C/C-/5++ binaries, PHP or web/database integration unless these services are specifically contracted. For these services, please see our Quote Request Form. |
|||||
|
||||||
Copyright
© 1995-2000
Motivational Marketing Associates, LLC
All Rights Reserved.