How to teach female to develop PHP from scratch: Write Requirement documents

Source: Internet
Author: User

Background: A high school girl in Beijing asked me to help her become a "technical consultant" for her practical training. The practical training required me to develop a web project independently. The development language she chose was php. In fact, I became a title party again. Although she has never used PHP before, she has forgotten the basics of html, css, and javascript ), I have written something in C and java.

Project Description:

Question-Resource Reservation Management System

Functional requirements --

1. Develop a Resource Reservation Management System for enterprises and institutions

2. Provide reservation functions to employees for different types of resources, such as meeting rooms, automobiles, and equipment.

3. After logging on to the system, an employee can view the current reservation of the specified resource and reserve the idle resources within the specified period of time.

4. You need to set different opening times for different resources based on the actual situation. For example, you can set the opening time from to each day for intelligent reservation during development time.

5. The minimum time units that can be scheduled for different resources are different. For example, the meeting room can be scheduled by minute. The minimum time is 15 minutes, and the car can be scheduled by hour. The minimum time is 2 hours.

6. The system should follow the principle of first come, first served.

7. You can cancel the reservation before using it. After cancellation, other users can continue the reservation.

Step 1: Write the requirement document

Computer science students generally take the software engineering course. Naturally, they know the importance of requirements. Even if you have never done this, you should have read the requirement documents written by others. If you compare the completion of a project to the building of a house, the demand is like a building design drawing. If the design is poor, the House will not look good. Although software development is more flexible than construction, at least the House cannot roll back the code and cancel the changes), but if the demand is not comprehensive and not strict, it usually greatly increases unnecessary workload and reduces work efficiency.

You think about it. Today, I told you that your code is half written. In a few days, I told you that the demand was changed. The previous code was useless. How do you feel? Although demand changes are common, once the demand gets out of control, the impact on the project is often disastrous.

Fortunately, I wrote the requirement document when I was designing a desktop software course. Otherwise, it would be quite troublesome to learn how to do it from the beginning. However, it would be a big problem if the first-entry children's shoes are too troublesome and do not need to be on demand. No matter whether they enter the formal work, they should contact more rigorous requirement documents, even if they only deal with the curriculum design in the school, when the scale of the software is large enough, it takes at least one day to reduce the development time by one week.

Step 2: Examples on the logon page

My sister wrote the requirement document, so I cannot be idle. Because I have only read a little about php and have not written a line of code in php. To stay ahead of my sister, I must learn what I want to use in advance. Because the project designed for this course has the login function, I plan to use this page as the first example to introduce php. In the future, the entire login function process will be described in more detail.

First, let's take a look at the simplest html login page with the code!

 
 
  1. <Html>
  2. <Head>
  3. <Meta charset = "gbk">
  4. <Title> User Logon page </title>
  5. </Head>
  6. <Body>
  7. <Form name = "login" action = "Controller. php" method = "post">
  8. <Td class = "tbl"> User name: </td> <input type = "text" name = "user_id"> </td>
  9. <Td class = "tbl"> password: </td> <input type = "text" name = "user_password"> </td>
  10. <Td> <input type = "submit" value = "log on to the system"> </td>
  11. </Form>
  12. </Body>
  13. </Html>

In order to let everyone reach out to the party improperly, I will not bring the page up. Everyone will copy the code and use a browser to see the effect. Why do I need to write these lines of code to my sister? I want my sister to get familiar with what the html code looks like again, and let her know why php and html are mixed together. After a while, you should have read the display effects of the above Code. In this case, see the following code after adding php:

 
 
  1. <? Php // php code starts
  2. Echo "
  3. Echo "
  4. Echo "<meta charset = \" gbk \ "> ";
  5. Echo "<title> User Logon interface </title> ";
  6. ?> <! -- Php code part ended -->
  7. </Head>
  8. <Body>
  9. <Form name = "login" action = "Controller. php" method = "post">
  10. <Td class = "tbl"> User name: </td> <input type = "text" name = "user_id"> </td>
  11. <Td class = "tbl"> password: </td> <input type = "text" name = "user_password"> </td>
  12. <? Php
  13. Echo "<td> <input type = \" submit \ "value = \" log on to the system \ "> </td>"
  14. ?>
  15. </Form>
  16. </Body>
  17. </Html>

This code mainly helps the girl understand the following points: 1) Use php Code <? Php?> Label 2) How to Use the echo statement to output html code, and escape the Code with the \ escape character for "" (double quotation marks. 3) How php code is mixed with html code.

PS: It is difficult to finish the first article, so I will write so much in the first article. The starting point is too high, but it is not good. It is easy to confuse beginners. Let's take a look at the Code as an example. You can change it, write it, and feel it.

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.