Đang chuẩn bị liên kết để tải về tài liệu:
PHP and MySQL Web Development - P122

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

PHP and MySQL Web Development - P122: PHP and MySQL Web Development teaches the reader to develop dynamic, secure, commercial Web sites. Using the same accessible, popular teaching style of the first edition, this best-selling book has been updated to reflect the rapidly changing landscape of MySQL and PHP. | Implementation 577 Listing 26.7 Continued headline story_text page writer created modified values headline story_text page . HTTP_SESSION_VARS auth_user . time time result mysql_query sql conn if result print There was a database error when executing pre sql pre print mysql_error exit if isset HTTP_POST_FILES picture name is_uploaded_file HTTP_POST_FILES picture tmp_name if isset story story mysql_insert_id type basename HTTP_POST_FILES picture type switch type case jpeg case pjpeg filename pictures story.jpg move_uploaded_file HTTP_POST_FILES picture tmp_name filename sql update stories set picture filename where id story result mysql_query sql conn break default print Invalid picture format . HTTP_POST_FILES picture type header Location . HTTP_POST_VARS destination The delete story link calls delete_story.php which actions a simple DELETE statement and returns the writer to the calling page.The code for delete_story.php is shown in Listing 26.8. 578 Chapter 26 Building a Content Management System Listing 26.8 delete story.php Is Used to Delete a Story from the Database php delete_story.php include include_fns.php conn db_connect story HTTP_GET_VARS story sql delete from stories where id story result mysql_query sql conn header Location . HTTP_SERVER_VARS HTTP_REFERER Searching Clicking the keywords link on the stories list brings up a new form for entering keywords against the story. There is no limit to the number of keywords that can be entered and each keyword is given a weight value with a higher value indicating that it is more relevant. Figure 26.7 shows the screen used to set keywords against a particular story. Figure 26.7 Setting keywords for a story. Implementation 579 The script keywords.php is fairly straightforward so we won t look at it in any detail. It is included on the CD-ROM. This script triggers the keyword_add.php and keyword_delete.php scripts.These scripts are also straightforward and are therefore not included here. The script .

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.