tailieunhanh - PHP: The Good Parts: Delivering the Best of PHP- P6

PHP: The Good Parts: Delivering the Best of PHP- P6: Vượt qua tất cả các hype về PHP và thâm nhập vào sức mạnh thực sự của ngôn ngữ này. Cuốn sách này khám phá những tính năng hữu ích nhất của PHP và làm thế nào họ có thể đẩy nhanh quá trình phát triển web, và giải thích lý do tại sao thường được sử dụng PHP yếu tố thường được sử dụng sai hoặc misapplied. Bạn sẽ tìm hiểu thêm phần nào sức mạnh để lập trình hướng đối tượng, và làm thế nào để sử dụng. | This however is a dynamically generated form as you can see in the following code php session_start folder _SESSION folder filename folder . file_handle fopen filename a open file for reading then clean it out pick up any text in the file that may already be there comments fread file_handle filesize filename fclose file_handle close this handle if _POST posted create file if first time and then save text that is in _POST question1 question1 _POST question1 file_handle fopen filename w open file for total overwrite if flock file_handle LOCK_EX do an exclusive lock if fwrite file_handle question1 FALSE echo Cannot write to file filename flock file_handle LOCK_UN release the lock close the file handle and redirect to next page fclose file_handle header Location else html head title Files folders - On-line Survey title head body table border 0 tr td Please enter your response to the following survey question td tr tr bgcolor lightblue td What is your opinion on the state of the world economy br Can you help us fix it td tr tr td form action PHP_SELF method POST input type hidden name posted value 1 br textarea name question1 rows 12 cols 35 comments textarea td tr tr td File Management As a Database Alternative 83 1 rf w I d I input type submit name submit value Submit form td tr table php Let me highlight a few of the lines of code here because this is where the file management and manipulation really takes place. After taking in the session information that we need and adding the filename to the end of the filename variable we are ready to start working with the files. Keep in mind that the point of this process is to display any information that may already be saved in the file and allow users to enter information or alter what they have already entered . So near the top of the code you see this command file_handle fopen filename a Using the file opening function fopen we ask PHP to provide us with a handle to that file and store it in the .

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