Đang chuẩn bị liên kết để tải về tài liệu:
Học php, mysql và javascript - p 45

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

Hiển thị các thông tin hiện tại Cuối cùng nhưng không kém, để người dùng có thể xem thông tin hiện nay trông giống như trước khi chỉnh sửa nó, chức năng showProfile từ rnfunctions.php được gọi là trước khi xuất ra dạng HTML. | Finally the image is saved as a jpeg file in the location defined by the variable saveto after which both the original and the resized image canvases are removed from memory using the imagedestroy function returning the memory that was used. Displaying the Current Profile Last but not least so that the user can see what the current profile looks like before editing it the showProfile function from rnfunctions.php is called prior to outputting the form HTML. If no profile exists yet nothing will be displayed. The result of loading Example 20-9 into a browser is shown in Figure 20-4 where you can see that the textarea has been prepopulated with the about me text. Figure 20-4. Editing a user profile rnprofile.php 421 Example 20-9. rnprofile.php php rnprofile.php include_once rnheader.php if isset _SESSION user die br br You need to login to view this page user _SESSION user echo h3 Edit your Profile h3 if isset _POST text text sanitizeString _POST text text preg_replace s s text query SELECT FROM rnprofiles WHERE user user if mysql_num_rows queryMysql query queryMysql UPDATE rnprofiles SET text text where user user else query INSERT INTO rnprofiles VALUES user text queryMysql query else query SELECT FROM rnprofiles WHERE user user result queryMysql query if mysql_num_rows result row mysql_fetch_row result text stripslashes row 1 else text text stripslashes preg_replace s s text if isset _FILES image name saveto user.jpg move_uploaded_file _FILES image tmp_name saveto typeok TRUE switch _FILES image type case image gif src imagecreatefromgif saveto break case image jpeg Both regular and progressive jpegs case image pjpeg src imagecreatefromjpeg saveto break 422 Chapter 20 Bringing It All Together case image png src imagecreatefrompng saveto break default typeok FALSE break if typeok list w h getimagesize saveto max 100 tw w th h if w h max w th max w h tw max elseif h w max h tw max h w th max elseif max w tw th max tmp imagecreatetruecolor tw th imagecopyresampled tmp

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.