Design and implementation of web-based online questionnaire survey system (PHP+Html+MySQL)

Table of contents

Chinese abstract 1
Abstract II
Chapter 1 Introduction 1
1.1 Research background 1
1.2 Design Goals 1
1.3 Structure of this article 1
Chapter 2 Introduction to system and program architecture and related technologies 3
2.1 System architecture and program architecture 3
2.1.1 Introduction to nginx 3
2.1.2 Introduction to thinkPHP 3
2.2 Introduction to development related technologies 4
2.2.1 PHP technology 4
2.2.2 mysql technology 5
Chapter 3 System Requirements Analysis and Design 7
3.1 Requirements Analysis 7
3.1.1 Platform system requirements analysis 7
3.1.2 Customer system requirements analysis 7
3.1.3 Analysis of ordinary user needs 7
3.1.4 Use case diagram 8
Chapter 4 System and Database Design 9
4.1 System design 9
4.2 Database design 10
Chapter 5 System Detailed Design and Functional Implementation 16
5.1 Folder structure of system project 16
5.2 Detailed design of platform management system 17
5.2.1 Login function 17
5.2.2 User list management 18
5.2.3 Questionnaire management function 19
5.2.4 Question type management function 20
5.2.5 Peripheral functions 21
5.3 Detailed design of customer management system 21
5.3.1 Registration and login function 21
5.3.2 Questionnaire list management 22
5.3.3 Customer personal information 22
5.4 User system design 23
5.4.1 Website home page promotion 23
5.4.2 Login and registration function 23
5.4.3 Questionnaire details and questionnaire submission 23
Summary 25
Reference 26
Acknowledgments 27
Chapter 3 System Requirements Analysis and Design

This questionnaire survey system is divided into three roles: platform, customers and ordinary users. Here is a brief explanation of these three roles:

(1) The platform is the website administrator and has ownership.
(2) Customer is the organization or individual who created the questionnaire. Because ordinary users may also be potential customers, ordinary users are also one of the customers.
(3) Users are the respondents who fill out the questionnaire.

3.1 Requirements analysis
3.1.1 Platform system requirements analysis
The platform, as the manager of the entire system, has the highest authority and needs to provide many functions. It should have the following functions:
(1) User management function: You can view the list of platform administrators and registered users and modify basic information on the system, or delete an existing user.
(2) Questionnaire management function: For questionnaires published by customers, the platform system needs to provide the function of viewing the questionnaire list, modifying the basic information of the questionnaire, changing the questionnaire questions, and saving the published functions.
(3) Question type management function: manage the list of question types that customers are allowed to use in the management system.
(4) Log function: log some operations so that you can query them in case of misoperation.
(5) Peripheral functions: In addition to the above main functions, it also provides some additional intuitive information display, such as how many customers the current system has, how many questionnaires have been submitted, and how many times it has been submitted. and a list of the latest and most popular questionnaires.

3.1.2 Analysis of customer system requirements
In order to provide customers with a good questionnaire generation platform, the platform needs to have the following functions:
(1) Registration and login function: Users can register to become a customer of the platform or a simple ordinary user according to their email address, mobile phone or customized nickname.
(2) Questionnaire management function: Customers can create specific questionnaires on the system, set themes, and provide a variety of question types for customers to choose from. After editing the questionnaire questions, users can preview the questionnaire, save the questionnaire, and publish the questionnaire.
(3) Personal information modification function: Customers can modify their personal information, email address, login password, etc. on the system.

3.1.3 Analysis of ordinary user needs
Ordinary users are divided into two types, one is registered and logged in users, and the other is tourist users. For logged-in and registered users, potential customers can also create their own questionnaires on the customer system.
In addition, the most important thing for ordinary users is to browse the questionnaires on the website, as well as fill in and submit the questionnaires.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>
Questionnaire Network
    </title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <link type="text/css" rel="stylesheet" href="{$Think.STATIC_DOMAIN}/css/index.css" />
    <script src="{$Think.STATIC_DOMAIN}/js/jquery.js"></script>
    <script src="{$Think.STATIC_DOMAIN}/js/index.js"></script>
</head>
<body>
    <input type="hidden" id="last_selected_type" value="{$last_selected_type}"><!--Hidden field, the last selected navigation bar-->
    <input type="hidden" id="last_search_keywords" value="{$last_search_keywords}"><!--Hidden field, last search term-->
    <div id="BS">
        <div class="headerwrapper">
            <div id="header" style="height:80px">
                <div class="sojump_logo" style="padding-top:15px;margin-top:0px;width:250px;height:65px;">
                        <a href="{$Think.const.STATIC_DOMAIN}" style="display:inline-block;font-size:24px;color:#3C763D;" >Online Questionnaire Website</a>
                        <a href="{$Think.const.STATIC_DOMAIN}">qss.codiy.net</a>
                </div>
                <div class="Header_r" style="margin:0px;height:82px;">
                    <div id="ctl00_divLogin" class="header_reg" style="margin:0px;">
                        <ul>
                            <li>
                                <a href="/User/Public/register">
                                    <span style="cursor: pointer;" class="header_btn">Register</span>
                                </a>
                            </li>
                            <li id="ctl00_liLogin">
                                <a href="/User/Public/login" class="new_titxt" style="font-size: 14px;">Login</a>
                            </li>
                        </ul>
                    </div>
                    <div id="NMenu" style="margin:0px;margin-top:15px;">
                        <ul style="float:right;">
                            <li id="ctl00_liIndex"><i></i><a href="{$Think.const.STATIC_DOMAIN}" class="indexnav">First& amp;nbsp; & amp; nbsp; & amp;nbsp; & amp;nbsp;page& amp;nbsp;</a></li>
                            <li id="ctl00_liCustomer" style="border: 0; padding-right: 0;"><i></i><a href="{$Think.const.STATIC_DOMAIN}" class ="indexnav">Questionnaire Center</a></li>
                            <li id="ctl00_liCustomer" style="border: 0; padding-right: 0;"><i></i><a href="#footer" class="indexnav" >Contact us</a></li>
                        </ul>
                    </div>
                </div>
            </div>
            
        </div>
        <div style="margin:0 auto; width:945px; text-align:left; margin-top:30px;;">
            
<div style="margin: 0 auto;">
    <div>
        <ul class="stat_tab" style="padding-left:45px; padding-top:0px;">
            <if condition="$Think.get.type eq 'all'"><li class="current"><elseif condition="$Think.get.type eq ''" /><li class="current"><else /><li></if>
                <a href="?type=all"><span>All</span></a>
            </li>
            <if condition="$Think.get.type eq '1'"><li class="current"><else /><li></if>
                <a href="?type=1"><span>Psychology</span></a>
            </li>
            <if condition="$Think.get.type eq '2'"><li class="current"><else /><li></if>
                <a href="?type=2"><span>Life</span></a>
            </li>
            <if condition="$Think.get.type eq '3'"><li class="current"><else /><li></if>
                <a href="?type=3"><span>Emotion</span></a>
            </li>
            <if condition="$Think.get.type eq '4'"><li class="current"><else /><li></if>
                <a href="?type=4"><span>Technology</span></a>
            </li>
            <if condition="$Think.get.type eq '5'"><li class="current"><else /><li></if>
                <a href="?type=5"><span>Enterprise</span></a>
            </li>
            <if condition="$Think.get.type eq '6'"><li class="current"><else /><li></if>
                <a href="?type=6"><span>Products</span></a>
            </li>
            <if condition="$Think.get.type eq '7'"><li class="current"><else /><li></if>
                <a href="?type=7"><span>Education</span></a>
            </li>
            <if condition="$Think.get.type eq '0'"><li class="current"><else /><li></if>
                <a href="?type=0"><span>Other</span></a>
            </li>
        </ul>
    </div>
</div>
 <div style="clear:both;"></div>
    <div style="margin: 10px 0 0 40px;">
        <div>
            <input id="search_keywords" style="width:380px; padding:3px 0 2px 5px; height:23px;border:2px #68ACFF solid;outline:none;vertical-align:middle;"
            onfocus="if(value=='Please enter the keyword'){this.style.color='#000000';value='';}"
            onblur="if(value==''){this.style.color='#666666';value='Please enter the keyword'}" value="Please enter the keyword\ "
            type="text" />
            <a class="btnbgbig" style="vertical-align:middle;" onclick="search_click();">
                <span>Search Questionnaire</span>
            </a>
        </div>
        <div style="clear:both;"></div>
   </div>
    <div style="clear:both;"></div>
    <div class="divhead864">
<div id="postmain">
    <div id="post_list" style="padding-top:1px;">
    <iframe style=" position:absolute; z-index:1; display:none;" id="iframeObj" frameborder="0"></iframe>
    <div id="divComplete" style="position:absolute;width:370px;z-index:2;"></div>

        <div style="clear:both;"></div>
        <div id="ctl00_ContentPlaceHolder1_post_list"></div>
               <foreach name="left_list" item="record">
               <div class="post_item">
                    <div class="post_item_body">
                        <h3>
                            <a href="{$record['url']}" target="_blank">{<!-- -->$record['title']}</a>
                        </h3>
                        <div class="post_item_summary">

                        </div>
                        <div class="post_item_foot">
                                <span>{<!-- -->$record['create_time']|date='Y-m-d H:i:s',###}</span>
                                 & amp;nbsp; & amp;nbsp;Number of questions (<span>{<!-- -->$record['question_num']}</span>)
                                <span class="article_view">
                                    <a href="{$record['url']}" class="grayline" target="_blank">View questionnaire (<span>{<!-- -->$record ['post_time']}</span>)</a> & amp;nbsp; & amp;nbsp;</span>
                       </div>
                    </div>
                </div>
                </foreach>
                <div class="clear">
                </div>
    </div>
    
    <div style="width: 540px; margin-top: 10px; text-align: center;" class="pager">
       <div id="ctl00_ContentPlaceHolder1_divPager">
 
       <span class="text" style="padding-left: 10px">{<!-- -->$pageinfo}</span>
                </div>
    </div>
   <div style="clear:both;"></div>
</div>
<div id="side_right">
    <div style="clear:both;"></div>
    <div>
        <a href="/newsurveys.aspx" style="float:left;" class='link-666'><b>List of popular questionnaires</b></a>
        <div class="divclear"></div>
    </div>
    <div class="widget_right">
        <h2 class="right_topic_title">Popular Questionnaire Ranking</h2>
        <div class="widget_right_body">
            <ul>
                <assign name='num' value='1'/>
                <foreach name="hot_list" item="record">
                    <li>
                        <div style="float:left;"><img src="img/index_icon{$num + + }.gif" style="border-width:0px;padding-right:5px;padding- top:3px; vertical-align:middle;" /></div>
                        <div style="float:left;width:240px;">
                            <a class="link-666" href="{$record['url']}" target="_blank">{<!-- -->$record['title ']}({<!-- -->$record['post_time']})</a></div>
                        <div style="clear:both;"></div>
                    </li>
                </foreach>
            </ul>
        </div>
    </div>
   
    <div>
        <a href="/newsurveys.aspx" style="float:left;" class='link-666'><b>Latest questionnaire list</b></a>
        <div class="divclear"></div>
    </div>
    <div class="widget_right">
        <h2 class="right_topic_title">Latest questionnaire ranking list</h2>
        <div class="widget_right_body">
            <ul>
                <assign name='num' value='1'/>
                <foreach name="new_list" item="record">
                    <li>
                        <div style="float:left;"><img src="img/index_icon{$num + + }.gif" style="border-width:0px;padding-right:5px;padding- top:3px; vertical-align:middle;" /></div>
                        <div style="float:left;width:240px;">
                            <a class="link-666" href="{$record['url']}" target="_blank">{<!-- -->$record['title ']}({<!-- -->$record['post_time']})</a></div>
                        <div style="clear:both;"></div>
                    </li>
                </foreach>
            </ul>
        </div>
    </div>
</div>
</div>
<div style="clear:both;"></div>
 
        </div>
        <div style="height:100px;"></div>
    </div>
    <div id="footer" style="height:70px;">
        <div class="coypright">
            <div style="float: left;">
                <img width="127" height="49" alt="" src="/images/indexnew/bottomlogo.gif"></div>
            <ul class="alCons">
                <li>Contact US</li>
                <li>Tel: 18650346179</li>
                <li>E-mail: [email protected]</li>
            </ul>
          
            <ul class="alCons alcons_txt">
                <li style="letter-spacing: 13px;">
                    <img width="210" height="25" alt="" src="{$Think.const.STATIC_DOMAIN}/img/bottom_right.gif"><br>
                    Professional questionnaire website</li>
            </ul>
        </div>
        
    </div>
    ?<div style='display:none;'></div>

</body>
</html>