TAILIEUCHUNG - Easy PHP Websites with the Zend Framework (phần 5)

Tham khảo sách 'easy php websites with the zend framework (phần 5)', 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ả | CHAPTER 7 PROCESSING FORMS AND SENDING EMAIL 181 keep in mind you need to create the directory images captcha the images directory residing in your application s public directory or alternatively use Zend_Captcha_Image s setImgDir method to explicitly specify an alternative directory. Validating the CAPTCHA Earlier I mentioned Zend_Captcha will handle the CAPTCHA validation for you. To validate a captcha just tell Zend_Captcha_Image the name of the form variable which will be passed back to the controller when instantiating the class. Then when the form variable is passed back use the isVal-id method like you would any other validation class 01 captcha new Zend_Captcha_Image array name gamer wordLen 5 02 captcha- setFont usr share fonts truetype ttf-bitstream-vera 03 captcha- generate 04 this- view- captcha captcha- render this- view 05 06 if captcha- isValid this- _request- getPost gamer 07 echo VALID 08 Conclusion The impressive form creation validation and filtering features offered by the Zend Framework leave you with no excuse for not properly vetting input arriving from external sources. Be sure to take advantage of these time-saving and perhaps job-saving features no matter the type of website. Likewise the Zend_Mail component makes sending e-mail from your website a total breeze replacing the tricky and error-prone strategies of the past. The next chapter tackles another important topic user management. In this chapter you ll learn how implement user registration and login mechanisms along with requisite features such as password recovery. Download at Download at CHAPTER 8 Managing Your User Community One of the most compelling aspects of the Web is it s a two-way street. A website can disseminate information almost as easily as it can ask for it greatly expanding the attractiveness of your website in the process by allowing users to manage profiles control site preferences such as layout and content availability and .

TỪ KHÓA LIÊN QUAN
Đã 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.