Today, we want to provide php scholars with a php online survey system source code. This is a simple application example from html to php, that is, code about the online voting system. Today, we want to provide php scholars with a php online survey system source code. This is a simple application example from html to php, that is, code about the online voting system.
Script ec (2); script
Html code
The Code is as follows: |
|
Questionnaire Form
// Define the display form function Function display_form (){ Global $ PHP_SELF; ?>
} ?> |
// Start the program
The Code is as follows: |
|
// Define the Processing Form Function Function process_form () { Global $ name; Global $ first; Global $ second; If ($ first = 'I am dump '){ $ First_message = 'You are not stupid. '; } Elseif ($ first = 'I am smart '){ $ First_message = 'You are not smart. '; } Else { $ First_message = 'You are like a smart person. '; } $ Favorite_second = count ($ second ); If ($ favorite_second <= 1) { $ Second_message = 'but you have done something wrong. Sorry! '; } Elseif ($ favorite_second> 1 & $ favorite_second <4) { $ Second_message = 'You are a sports-loving orangutan. '; } Else { $ Second_message = 'you have been exercising too much, and you have been over-exercising for the orangutan :('; } Echo "this is a test for orangutan:
"; Echo "Hello! Your name is $ name.
"; Echo "your test result is ..... $ First_message $ second_message "; } ?> If (empty ($ stage) {display_form ();} Else {process_form ();} ?> |
VoteLine Survey SystemThe principle of an instance is to create a single choice or selection box to collect user information.