TAILIEUCHUNG - Beginning PHP and MySQL E-Commerce From Novice to Professional phần 6

Tạo một thư mục mới trong thư mục gốc của dự án của bạn (tshirtshop) đặt tên là kịch bản, thêm một tập tin mới có tên trong đó, và gõ đoạn mã sau: / / Giữ một thể hiện của XMLHttpRequest var xmlHttp = createXmlHttpRequestObject (); / / Hiển thị lỗi tin nhắn (đúng) hoặc làm giảm hành vi không AJAX | Simpo PDF Merge and Split Unregistered Version - http CHAPTER 11 CATALOG ADMINISTRATION PRODUCTS AND ATTRIBUTES 341 Note A complete description of the _FILES superglobal is available at http manual en . The move_uploaded_file PHP function is used to move the file from the temporary location to the product_images folder Use the move_uploaded_file PHP function to move the file from its temporary location to the product_images folder move_uploaded_file _FILES ImageUpload tmp_name SITE_ROOT . product_images . _FILES ImageUpload name After uploading a product picture the file name must be stored in the database otherwise the file upload has no effect Update the product s information in the database Catalog SetImage this- _mProductId _FILES ImageUpload name As you can see it s pretty simple to handle file uploads with PHP. Product Details Implementing the Business Tier To implement the business tier you ll need to add the following methods to the Catalog class UpdateProduct updates a product s details name description price and discounted price. DeleteProduct completely removes a product from the catalog. RemoveProductFromCategory is called when the Remove from category button is clicked to unassign the product from a category. GetCategories returns all the categories from our catalog. GetProductInfo returns the product details. GetCategoriesForProduct is used to get the list of categories that are related to the specified product. SetProductDisplayOption sets the product s display setting. AssignProductToCategory assigns a product to a category. MoveProductToCategory moves a product from one category to another. GetAttributesNotAssignedToProduct returns all the attribute values from the table of attribute_values that have not been assigned to a product. Simpo PDF Merge and Split Unregistered Version - http 342 CHAPTER 11 CATALOG ADMINISTRATION PRODUCTS AND ATTRIBUTES AssignAttributeValueToProduct .

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