tailieunhanh - Sams Teach Yourself PHP, MySQL and Apache in 24 Hours phần 3

Sau khi tạo một trang web đơn giản bằng cách sử dụng những công cụ này, người đọc sẽ có thể quản lý một danh sách gửi thư đơn giản, và để tạo ra một cuốn sách địa chỉ trực tuyến, giỏ mua hàng, và cửa hàng. Cuốn sách cũng dạy người đọc làm thế nào để tinh chỉnh | Team LiB 1 PREVIOUS NEXT Workshop The workshop is designed to help you anticipate possible questions review what you ve learned and begin putting your knowledge into practice. Quiz 1 How would you use an if statement to print the string Youth message to the browser if an integer variable age is between 18 and 35 If age contains any other value the string Generic message should be printed to the browser. A1 age 22 if age 18 age 35 print Youth message BR n else print Generic message BR n 2 How would you extend your code in question 1 to print the string Child message if the age variable is between 1 and 17 A2 age 12 if age 18 age 35 print Youth message BR n elseif age 1 age 17 print Child message BR n else print Generic message BR n 3 How would you create a while statement that increments through and prints every odd number between 1 and 49 A3 num 1 while num 49 print num BR n num 2 4 How would you convert the while statement you created in question 3 into a for statement A4 for num 1 num 49 num 2 print num BR n Activity Review the syntax for control structures. Think about how the techniques you ve learned will help you in your scripting. Perhaps some of the script ideas you develop will be able to behave in different ways according to user input or will loop to display an HTML table. Start to build the control structures you will be using. Use temporary variables to mimic user input or database queries for the time being. Team LiB PREVIOUS NEXT K Team LiB 1 PREVIOUS NEXT Hour 6. Working with Functions Functions are at the heart of a well-organized script making code easy to read and reuse. No large project would be manageable without them. Throughout this hour we will investigate functions and demonstrate some of the ways in which they can save you from repetitive work. In this hour you will learn How to define and call functions How to pass values to functions and receive values in return How to call a function dynamically using a string stored in a variable How

TỪ KHÓA LIÊN QUAN