Practical PHP and MySQLBuilding Eight Dynamic Web Applications phần 7

Đối với một người sử dụng bình thường, chỉ có những câu hỏi trong chủ đề này (s) rằng ông sở hữu được trả lại: Nếu không có thiết lập hợp pháp được thông qua để biến GET func, khối mặc định được nhập vào. Mã này yêu cầu người sử dụng dự án mà cô muốn để quản lý. Khi một người dùng đã lựa chọn một dự án, | CHAPTER 8 Creating a Web-Based Calendar 299 for i 0 i 23 i echo option value . sprintf 02d i . . sprintf 02d i . option select select name startminute php for i 0 i 60 i echo option value . sprintf 02d i . . sprintf 02d i . option select td tr tr td End Time td td select name endhour php for i 0 i 23 i echo option value . sprintf 02d i . . sprintf 02d i . option select select name endminute php for i 0 i 60 i echo option value . sprintf 02d i . . sprintf 02d i . option select td tr tr td Description td td textarea cols 15 rows 10 name description textarea td tr tr td td td input type submit name submit value Add Event td tr table form 300 Practical PHP and MySQL At the top of the form a check is made to see if the error GET variable is available. If it is an error message is displayed. The script to process the form is . Create this file and begin adding the following code php require if empty _POST name error 1 if empty _POST description error 1 if _POST starthour _POST endhour error 1 if _POST starthour _POST endhour error 1 if error 1 header Location . config_basedir . error 1 eventdate . _GET date exit This batch of if statements perform some validation checks. These checks work similarly to previous validation examples if a check fails the error variable is created and the page redirects. The checks are made to ensure that the end time is not earlier than the start time and that the start and end time are not the same. A check is also made to ensure that the text boxes are not empty. Prepare the variables if error 1 header Location . config_basedir . error 1 eventdate . _GET date exit CHAPTER 8 Creating a Web-Based Calendar 301 elements explode - _POST date redirectdate elements 1 . - . elements 0 finalstart _POST starthour . . _POST startminute . 00 finalend _POST endhour . . _POST endminute . 00 The first line in this block uses explode to fill the elements array with the different parts of the date. The second .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
5    443    2    27-04-2024
5    87    2    27-04-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.