






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







1
XHTML form collects information (^) Database or other PHP script
XHTML output of results
Database or other storage
Client/Server dividing line
2
Input fields must be contained inside a form tag. All input fields must have a name. Names cannot have spaces in them. Fields should be named well for clear identification. Form action should be URL to PHP processing script. Appropriate form transmission method selected:pp p
Name/value pairs appended in clear text to the URL of the receiving page/script.g p g / p Each name/value pair separated by '&'. Value data automatically URL encoded. Names are taken from the form field names.
GET URLs can be saved, bookmarked, etc. and used to recall the script with the same data. GET strings provide 'transparency' that may/may not be desired. Long GET strings may be problematic.
4
5
if (condition)if (condition) { // conditional code here }
if (condition) { // conditional code here } else { // conditional code here }
7
Operator Meaning Example ! Not !$a &&, and And $a && $b ||, or Or $a || $b xor exclusive or $a xor $b
"; echo empty($testvar); ?>
8
trim($s) returns string $s with whitespace from beginning and end of a string removed. ltrimltrim($s)($s) returns string $s with leading white spacereturns string $s with leading white space removed. chop($s) returns string $s with trailing white space removed. strtoupper($s) —returns uppercase of string $s.
strtolowerstrtolower($s)($s) —returns lowercase of string $s. returns lowercase of string $s. ucfirst($s) —returns capitalized first character of string $s, if alphabetic. ucwords($s) —returns capitalized first character of every word in string $s, if alphabetic.
10
BBrowser may have scripting turned off. h i i d ff User may save and edit page with client-side scripting edited.
Never trust any form data! Check to make sure it
fits the profile for valid data.fits the profile for valid data.