Đang chuẩn bị liên kết để tải về tài liệu:
Phát triển web với PHP và MySQL - p 71

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Building a Mailing List Manager CHAPTER 28 675 LISTING 28.3 Continued else { echo “Sorry, that email address is already registered here.”; echo “You will need to log in with that address to change “ .” Web settings.”; return false; } } else // new account { $query = “insert into subscribers values (‘$details[email]’, ‘$details[realname]’, ‘$details[mimetype]’, password(‘$details[new_password]’), 0)”; if(db_connect() && mysql_query($query)) { return true; } else { echo “Could not store new account.”; return false; } } } } 28 BUILDING A MAILING LIST MANAGER This function first checks that the user has filled in the required details. If this is okay, the function will then either. | Building a Mailing List Manager 675 Chapter 28 Listing 28.3 Continued else echo p Sorry that email address is already registered here. echo p You will need to log in with that address to change . Web settings. return false else new account query insert into subscribers values details email details realname details mimetype password details new_password 0 if db_connect mysql_query query return true else echo Could not store new account. br br br br br br return false This function first checks that the user has filled in the required details. If this is okay the function will then either create a new user or update the account details if the user already exists. A user can only update the account details of the user he is logged in as. This is checked using the get_email function which retrieves the email address of the user who is currently logged in. We ll return to this later as it uses session variables that are set up when the user logs in. Logging In If a user fills in the login form we saw back in Figure 28.4 and clicks on the Log In button she will enter the index.php script with the email and password variables set. This will activate the login code which is in the pre-processing stage of the script as follows 28 Building a Mailing List Manager Building Practical PHP and MySQL Projects 676 Part V Listing 28.3 Continued need to process log in or out requests before anything else if email password login login email password if login admin status . p b .get_real_name email . b logged in . successfully as b Administrator b br br br br br admin_user email session_register admin_user else if login normal status . p b .get_real_name email . b logged in . successfully. br br normal_user email session_register normal_user else status . p Sorry we could not log you in with that email address and password. br As you can see we first try to log them in using the login function from the user_auth_fns.php library. This is slightly different from the login functions we .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.