Đang chuẩn bị liên kết để tải về tài liệu:
Lecture Introduction to web engineering - Lec 29: File uploading in PHP
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
After studying this chapter you will be able to understand: FILES super global variable, file uploading in PHP, storing reference of uploaded file in database, user registration in connections web application with file upload. | Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 1 Creating database in MySQL using WAMP Connecting PHP with MySQL Inserting data in database CONNECTIONS: user registration Basharat Mahmood, Department of Computer Science,CIIT,Islamabad,Pakistan. 2 2 Department of Computer Science, CIIT Islamabad. FILES super global variable File uploading in PHP Storing reference of uploaded file in database User registration in CONNECTIONS web application with file upload Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 3 $_FILES: contains any item uploaded to the server when the post method is used an array type variable Created automatically Can be accessed on other pages Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 4 Keeps information about Name Size Type Tmp_name Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 5 FORM attributes required: Method should be post Enctype should be . | Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 1 Creating database in MySQL using WAMP Connecting PHP with MySQL Inserting data in database CONNECTIONS: user registration Basharat Mahmood, Department of Computer Science,CIIT,Islamabad,Pakistan. 2 2 Department of Computer Science, CIIT Islamabad. FILES super global variable File uploading in PHP Storing reference of uploaded file in database User registration in CONNECTIONS web application with file upload Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 3 $_FILES: contains any item uploaded to the server when the post method is used an array type variable Created automatically Can be accessed on other pages Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 4 Keeps information about Name Size Type Tmp_name Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 5 FORM attributes required: Method should be post Enctype should be multipart/form-data Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 6 Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 7 File type name Asad Choose File submit No File Chosen Mypci.jpg name Asad $_POST $_FILES pic [name] =>file name [type] =>file type [size] =>file size =>tmp name [tmp_name] Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 8 Accessing file information $_FILES[‘input-field name’][‘name’]; $_FILES[‘pic’][‘name’]; $_FILES[‘input-field name’][‘type’]; $_FILES[‘pic’][‘type’]; $_FILES[‘input-field name’][‘size’]; $_FILES[‘pic’][‘size’]; Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 9 enctype method Input field Submit button Basharat .