PHP & MySQL for Dummies- P4
Số trang: 50
Loại file: pdf
Dung lượng: 0.00 B
Lượt xem: 7
Lượt tải: 0
Xem trước 5 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Tham khảo tài liệu php & mysql for dummies- p4, công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả
Nội dung trích xuất từ tài liệu:
PHP & MySQL for Dummies- P4 Part III PHPPlease purchase PDF Split-Merge on www.verypdf.com to remove this watermark. In this part . . . I n Part III, you find out how to use PHP for your Web database application. Here are some of the topics described: U Adding PHP to HTML files U PHP features that are useful for building a dynamic Web database application U Using PHP features U Using forms to collect information from users U Showing information from a database in a Web page U Storing data in a database U Moving information from one Web page to the next You find out everything you need to know to write PHP programs.Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Chapter 6 General PHP In This Chapter ▶ Adding PHP sections to HTML files ▶ Writing PHP statements ▶ Using PHP variables ▶ Comparing values in PHP variables ▶ Documenting your programs P rograms are the application part of your Web database application. Programs perform the tasks: Programs create and display Web pages, accept and process information from users, store information in the data- base, get information out of the database, and perform any other necessary tasks. PHP, the language that you use to write your programs, is a scripting lan- guage designed for use on the Web. It has features to aid you in programming the tasks needed by dynamic Web applications. In this chapter, I describe the general rules for writing PHP programs — the rules that apply to all PHP statements. Consider these rules similar to general grammar and punctuation rules. In the remaining chapters in Part III, you find out about specific PHP statements and features and how to write PHP pro- grams to perform specific tasks. Adding a PHP Section to an HTML Page PHP is a partner to HTML, enabling HTML to do things it can’t do on its own. For example, HTML can display Web pages, and HTML has features that allow you to format those Web pages. HTML also allows you to display graphics in your Web pages and to play music files. But HTML alone does not allow you to interact with the person viewing the Web page.Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 134 Part III: PHP HTML is almost interactive. That is, HTML forms allow users to type informa- tion that the Web page is designed to collect; however, you can’t access that information without using a language other than HTML. PHP processes form information and allows other interactive tasks as well. HTML tags are used to make PHP language statements part of HTML scripts. The file is named with a .php extension. (The PHP administrator can define other extensions, such as .phtml or .php5, but .php is the most common. In this book, I assume .php is the extension for PHP programs.) The PHP lan- guage statements are enclosed in PHP tags with the following form: Sometimes you can use a shorter version of the PHP tags. You can try using without the php. If short tags are enabled, you can save a little typing. However, if you use short tags, your programs will not run if they’re moved to another Web host where PHP short tags are not activated. PHP processes all statements between the two PHP tags. After the PHP sec- tion is processed, it’s discarded. Or if the PHP statements produce output, the PHP section is replaced by the output. The browser doesn’t see the PHP section — the browser ...
Nội dung trích xuất từ tài liệu:
PHP & MySQL for Dummies- P4 Part III PHPPlease purchase PDF Split-Merge on www.verypdf.com to remove this watermark. In this part . . . I n Part III, you find out how to use PHP for your Web database application. Here are some of the topics described: U Adding PHP to HTML files U PHP features that are useful for building a dynamic Web database application U Using PHP features U Using forms to collect information from users U Showing information from a database in a Web page U Storing data in a database U Moving information from one Web page to the next You find out everything you need to know to write PHP programs.Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Chapter 6 General PHP In This Chapter ▶ Adding PHP sections to HTML files ▶ Writing PHP statements ▶ Using PHP variables ▶ Comparing values in PHP variables ▶ Documenting your programs P rograms are the application part of your Web database application. Programs perform the tasks: Programs create and display Web pages, accept and process information from users, store information in the data- base, get information out of the database, and perform any other necessary tasks. PHP, the language that you use to write your programs, is a scripting lan- guage designed for use on the Web. It has features to aid you in programming the tasks needed by dynamic Web applications. In this chapter, I describe the general rules for writing PHP programs — the rules that apply to all PHP statements. Consider these rules similar to general grammar and punctuation rules. In the remaining chapters in Part III, you find out about specific PHP statements and features and how to write PHP pro- grams to perform specific tasks. Adding a PHP Section to an HTML Page PHP is a partner to HTML, enabling HTML to do things it can’t do on its own. For example, HTML can display Web pages, and HTML has features that allow you to format those Web pages. HTML also allows you to display graphics in your Web pages and to play music files. But HTML alone does not allow you to interact with the person viewing the Web page.Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 134 Part III: PHP HTML is almost interactive. That is, HTML forms allow users to type informa- tion that the Web page is designed to collect; however, you can’t access that information without using a language other than HTML. PHP processes form information and allows other interactive tasks as well. HTML tags are used to make PHP language statements part of HTML scripts. The file is named with a .php extension. (The PHP administrator can define other extensions, such as .phtml or .php5, but .php is the most common. In this book, I assume .php is the extension for PHP programs.) The PHP lan- guage statements are enclosed in PHP tags with the following form: Sometimes you can use a shorter version of the PHP tags. You can try using without the php. If short tags are enabled, you can save a little typing. However, if you use short tags, your programs will not run if they’re moved to another Web host where PHP short tags are not activated. PHP processes all statements between the two PHP tags. After the PHP sec- tion is processed, it’s discarded. Or if the PHP statements produce output, the PHP section is replaced by the output. The browser doesn’t see the PHP section — the browser ...
Tìm kiếm theo từ khóa liên quan:
thủ thuật máy tính công nghệ thông tin tin học quản trị mạng computer networkTài liệu liên quan:
-
52 trang 434 1 0
-
24 trang 359 1 0
-
Top 10 mẹo 'đơn giản nhưng hữu ích' trong nhiếp ảnh
11 trang 320 0 0 -
Làm việc với Read Only Domain Controllers
20 trang 311 0 0 -
74 trang 303 0 0
-
96 trang 299 0 0
-
Báo cáo thực tập thực tế: Nghiên cứu và xây dựng website bằng Wordpress
24 trang 291 0 0 -
Đồ án tốt nghiệp: Xây dựng ứng dụng di động android quản lý khách hàng cắt tóc
81 trang 286 0 0 -
EBay - Internet và câu chuyện thần kỳ: Phần 1
143 trang 277 0 0 -
Tài liệu hướng dẫn sử dụng thư điện tử tài nguyên và môi trường
72 trang 270 0 0