TAILIEUCHUNG - Học php, mysql và javascript - p 40

Thông qua kết hợp Metacharacters Tất cả các biểu thức chính quy phải được đặt trong dấu gạch chéo. Trong thời hạn những dấu gạch chéo, một số ký tự có ý nghĩa đặc biệt, có metacharacters gọi. | Example 17-3. The program php Start with the PHP code forename surname username password age email if isset _POST forename forename fix_string _POST forename if isset _POST surname surname fix_string _POST surname if isset _POST username username fix_string _POST username if isset _POST password password fix_string _POST password if isset _POST age age fix_string _POST age if isset _POST email email fix_string _POST email fail validate_forename forename fail . validate_surname surname fail . validate_username username fail . validate_password password fail . validate_age age fail . validate_email email echo html head title An Example Form title if fail echo head body Form data successfully validated forename surname username password age email. body html This is where you would enter the posted fields into a database exit Now output the HTML and JavaScript code echo _END -- The HTML section -- style .signup border 1px solid 999999 font normal 14px Helvetica color 444444 style script type text javascript function validate form fail validateForename fail validateSurname fail validateUsername fail validatePassword fail validateAge fail validateEmail Redisplaying a Form After PHP Validation 371 if fail return true else alert fail return false script head body table class signup border o cellpadding 2 cellspacing 5 bgcolor eeeeee th colspan 2 align center Signup Form th tr td colspan 2 Sorry the following errors were found br in your form p font color red size 1 i fail i font p td tr form method post action onSubmit return validate this tr td Forename td td input type text maxlength 32 name forename value forename td tr tr td Surname td td input type text maxlength 32 name surname value surname td tr tr td Username td td input type text maxlength 16 name username value username td tr tr td Password td td input type text .

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