TAILIEUCHUNG - How to do everything with PHP (phần 7)

Tham khảo tài liệu ' how to do everything with php (phần 7)', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 284 How to Do Everything with PHP MySQL body php if _POST submit form not submitted form action _SERVER PHP_SELF method post Username 3-8 char br input type text name username p Password 5-8 char br input type password name password p Email address br input type text name email p Date of Birth br Month input type text name month size 2 Day input type text name day size 2 Year input type text name year size 4 p Hobbies select at least b three b br input type checkbox name hobbies value Sports Sports input type checkbox name hobbies value Reading Reading input type checkbox name hobbies value Travel Travel input type checkbox name hobbies value Television Television input type checkbox name hobbies value Cooking Cooking p Subscriptions Select at least b two b br select name subscriptions multiple option value General General Newsletter option option value Members Members Newsletter option option value Premium Premium Newsletter option select p input type submit name submit value Sign Up form php else array to store the error messages ERRORS array TEAM LinG CHAPTER 14 Validating User Input 285 validate username field username ereg A a-zA-Z 3 8 _POST username J ERRORS Enter valid username J mysql_escape_string trim _POST username validate password field password ereg A a-z0-9 5 8 _POST password J ERRORS Enter valid password trim _POST password validate email field email ereg A a-zA-Z0-9_- .a-zA-Z0-9_- @ a-zA-Z0-9_- J a-zA-Z0-9_- _POST email J ERRORS Enter valid email address trim _POST email validate date of birth field dob checkdate _POST month _POST day _POST year J ERRORS Enter valid date of birth J date Y-m-d mktime 0 0 0 _POST month _POST day J _POST year validate hobbies field hobbies sizeof _POST hobbies 3 J ERRORS Please select at least three hobbies J implode _POST hobbies validate subscriptions field subscriptions sizeof _POST subscriptions 2 ERRORS J Please select at least two subscriptions J implode _POST subscriptions verify if there were any errors by .

Đã 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.