How to teach a female classmate to develop PHP from scratch: Writing Requirements Document _php Tutorial

Source: Internet
Author: User
Background: In Beijing High School female classmate let me help when her training "technical consultant", the training requires individuals to develop a Web project independently, she chose the development language is PHP. In fact, I was once a title party, although she has never used PHP before, but there is a little bit of HTML, CSS, JavaScript Foundation is said to have forgotten it, has been useful C and Java write things.

Project Description:

Topic--Resource Reservation management system

Functional Requirements--

1. Development of a resource reservation management system for enterprises and institutions

2. Provide staff with appointment functions for different categories of resources, such as conference rooms, automobiles, equipment, etc.

3. After the employee logs in to the system, you can view the current schedule for the specified resource, and you can reserve resources for a specified period of time.

4. Different resources need to be set according to the circumstances of different opening hours, such as daily from 8:00 to 18:00, for intelligent in the development time to make a reservation

5. Different resources can be predetermined the minimum time unit is different, such as meeting room by minute booking, the shortest 15 minutes, the car by the hour booking, the shortest 2 hours.

6. The system is scheduled on a first-come, first-served basis.

7. After the user has been booked, it can be canceled before use, and after cancellation, other users can continue booking

The first step: write the requirements document

Computer professional students generally have been software engineering This course, naturally know to do the importance of demand. Even if they have not, comrades who have worked experience should have read the requirements of others. If the completion of a project is compared to building a house, then the demand is like a building plan, if the design is not good, then the building will not look good. While software development is more flexible than architecture, at least the house cannot roll back the code, undo the change, but if the demand is not completely and strictly, it will often greatly increase unnecessary workload and reduce work efficiency.

You think, today told you such a demand, you write half of the code, a few days to tell you the need to change, the previous code is useless, how do you feel? While demand changes are common, the impact on projects is often catastrophic once demand is out of control.

Fortunately, sister before doing desktop software curriculum design when the need to write a document, or to start from scratch to learn how to do the demand is a pretty troublesome thing. But if the newly-started children's shoes do not need to do a lot of trouble, and regardless of entering the formal work to contact more stringent requirements of the document, even if only to cope with the school curriculum design, in the case of large enough software, to do the demand for a day, at least, can shorten the development time by one weeks.

Step Two: Example of landing page

Sister wrote the requirements of the document went, then I can not idle. Because I just read a little bit about PHP before, and did not use PHP to write a line of code, in order to walk in front of the sister, must be in advance to learn what her sister to use. Since this course is designed to have a login function, I intend to use this page as the first example to introduce PHP, and will later explain the entire process of login functionality in more detail.

First, let's look at one of the simplest HTML login pages, on the code!

 
 
  1. < HTML >
  2. <head >
  3. < meta charset="GBK">
  4. <title> User Login interface title>
  5. head >
  6. <body >
  7. < form name = "login" action = "controller.php" span class= "attribute" >method = "post" >
  8. < td class = "TBL" > User name: !-- TD > < TD > < input type = "text" name = "user_id" span class= "tag" >> "!-- td
  9. < td class = "tbl" > Password: !-- td > < td > < input type = "text" name = "User_password" > !-- TD >
  10. < TD > < input type="Submit" value="Log in System" > td >
  11. form >
  12. body >
  13. HTML >

In order to let everyone inappropriate to reach the party, I will not put the page up, we copy the code with a browser to see the effect. Why do I have to write these lines of code for my sister? Mainly want to let sister re-familiar with the HTML code look like, and is to let sister know why PHP and HTML mixed together to pave the way. After a while, you should have seen the above code display effect. In this case, see the following PHP code:

 
 
  1. PHP //php Code section starts
  2. echo " < HTML > ";
  3. echo " < Head > ";
  4. echo " < Meta CharSet=\ "gbk\">";
  5. echo " < title > User Login Interface title>";
  6. ?>
  7. Head >
  8. < Body >
  9. < form name = "login" action = "controller.php" method = "POST" >
  10. < td class = "TBL" > User name: !-- TD > < TD > < input type = "text" name = "user_id" span class= "tag" >> "!-- td
  11. < TD class="tbl"> Password: td> < TD > < input type="text" name="User_ Password "> td >
  12. Php
  13. echo " < TD > < input type=\ "submit\" value=\ "Log in System \"> TD >"
  14. ?>
  15. form >
  16. Body >
  17. HTML >

This code mainly let sister understand this: 1) PHP code to be labeled with a label 2) how to use the Echo statement to output the HTML code, in addition to the "" "(double quotation marks) with the \ escape character) to escape. 3) How the PHP code is mixed with HTML code.

PS: It's hard to get started, so much is written in the first article. The starting point is too high but not good, easy to confuse the beginner. Take a look at the code as an example, change it yourself, write it, feel it.

http://www.bkjia.com/PHPjc/601050.html www.bkjia.com true http://www.bkjia.com/PHPjc/601050.html techarticle background: High school girls in Beijing let me help when her practical training technical consultant, the training requires individuals to independently develop a Web project, she chose the development language is PHP. In fact, I became a ...

  • 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.