A short note about PHP: PHP has following characteristics: ----------------------------------- a script that executes server side user only sees result, never the code--> compare the index.php file and the source code for the websit not an extension for hmtl often used as html extension PHP simple functionalities: -------------------------------- simple echo line ----------------- php prints simple text embedding what is generated from php in html '; ?> starts with a lot like perl $, '', "" include line -------------- like #include in c main use for include header files you can also include functions using php formtest.php -------------
html creates form once user clicks on submit, form sent to the php file $_POST is a php variable counter -------- code starting with % use php to set length --------------------------------------------------- assignment (optional, can be used as extra credit) --------------------------------------------------- poll site Page 1: -------- Which CPU is the best (radio buttons) Opteron Athlon 64 Pentium 4 Power 5 Other (submit button) submit view result Page2: ------ Results: CPU name (Bar generated with table) percentage ============== php makes cookie handling easy Extra credit: 1. cookie to avoid multiple voting from the same user 2. "flock" php code so that simultaneous users won't clash source.txt keyword to goole: php cookie php forward