Php online survey system source code-voting instance-PHP source code

Source: Internet
Author: User
Tags php online
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.