tailieunhanh - The Essential Guide to Dreamweaver CS4 with CSS, Ajax, and PHP phần 8

Vật dụng khác đòi hỏi phải có kiến thức về jQuery hoặc YUI Thư viện API. Sử dụng jQuery và Thư viện YUI Trong chương 9, tôi đã giới thiệu cho các bạn làm thế nào để xây dựng một hình thức thông tin phản hồi và xác nhận đầu vào ở phía khách hàng với các vật dụng Spry xác nhận. | THE ESSENTIAL GUIDE TO DREAMWEAVER CS4 WITH CSS AJAX AND PHP Displaying the error messages Now that the checks are complete you need to build the logic that determines whether the record is inserted in the database. If there are no errors the new record is inserted into the database and the user is redirected to the next page. However if errors are detected the INSERT command is ignored and the form needs to be redisplayed with the appropriate error messages. Building the error detection logic This section completes the validation process by wrapping the code that inserts the record in a conditional statement to prevent it from being executed if any errors are discovered. You will also add code to the insert form to display any error messages. Continue working with the same file. 1. If no errors have been found the error array will contain zero elements which as you know PHP treats as false. Wrap the remaining section of the Insert Record server behavior code with this conditional statement the exact location is shown in Figure 15-8 if no errors insert the details into the database if error Insert Record server behavior code Insert conditional statement here pwdOR Í_POST pwd - shal _POST pwd insertSQL sprintf INSERT INTO users first_naae faaily_naae usernaae pwd adam_pnv VALUES Is Is Is Is Is GetSQLValueStrlnq iPOST firstnaae text GetSQLValueStrlnq i POST faallynaae J text GetSQLValueString i_POST usemaae1 text GetSQLValueString _POST pwd J text GetSQLValueStrmg Í POST adain_priv 1 text is already in use. Please choose a different usemaae. problem with the database. Please try later. header sprintf Location Is insertGoTo insertGoTo if lsset _SERVER QUERY_STRING D I insertGoTo . 3trpo3 lnsertGoTa insertGoTo .- _SERVER QUERY_STRING aysql_select_dfc database_connAdain connAdaln Resultl aysql_query SinsertSQL connAdaln If Result ĩ Bysql_errno 1062 error usernaae _POST usernaae elself aysql_error0 error dbError Sorry there was a DOCTYPE html PUBLIC - W3C

crossorigin="anonymous">
Đã 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.