PHP 5/MySQL Programming- P8

PHP 5/MySQL Programming- P8:computer programming has often been seen as a difficult and arcane skill. Programming languages are difficult and complicated, out of the typical person’s reach. However, the advent of the World Wide Web has changed that to some extent. It’s reasonably easy to build and post a Web page for the entire world to see. The language of the Web is reasonably simple, and numerous applications are available to assist in the preparation of static pages | 13 A PHP program looks a lot like a typical HTML page. The difference is the special tag which specifies the existence of PHP code. Any code inside the tag is read by the PHP interpreter and then converted into HTML code. The code written between the and symbols is PHP code. I added two commands to the page. Look at the output of the program shown in Figure . You might be surprised. figure The page mixes HTML with some other things. Chapter 1 Exploring the PHP Environment Examining the Results This page has three distinct types of text. Hello in PHP is ordinary HTML. I wrote it just like a regular HTML page and it was displayed just like regular HTML. Hello world was written by the PHP program embedded in the page. The rest of the page is a bit mysterious. It contains a lot of information about the particular PHP engine being used. It actually stretches on for several pages. The phpInfo command generated all that code. This command displays information about the PHP installation. It isn t that important to understand all the information displayed by the phpInfo command. It s much more critical to appreciate that when the user requests the Web page the text is first run through the PHP interpreter. This program scans for any PHP commands executes them and prints HTML code in place of the original commands. All the PHP code is gone by the time a page gets to the user. 14 PHP 5 MySQL Programming for the Absolute Beginner For proof of this point your browser at and view the source code. It looks something like this html head title Hello in PHP title head body h1 Hello in PHP h1 Hello world DOCTYPE HTML PUBLIC - W3C DTD HTML Transitional EN html head style type text css --a text-decoration none a hover text-decoration underline hl font-family arial helvetica sans-serif font-size 18pt fontweight bold h2 font-family arial helvetica sans-serif font-size 14pt fontweight bold body td font-family arial helvetica sans-serif font-size 10pt th .

Không thể tạo bản xem trước, hãy bấm tải xuống
257    68    1    29-03-2023
Đã 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.