freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

php畢業(yè)設(shè)計(jì)英文文獻(xiàn)翻譯-資料下載頁

2025-06-29 09:16本頁面
  

【正文】 s between PHP tags. Anything else in the file is returned as part of the HTML page, just as seen earlier in the first example.Here’s another example. The following statement does not work, even though the mand is part of PHP’s language:echo “This won’t work.”The statement won’t work because it doesn’t follow a basic syntax rule that requires all statements to be terminated with a semicolon. Some special statements must have the semicolon left out, but not many. (The ones that do will be pointed out as we e to them.) For now, just remember that statements should end with a semicolon. The following statement is a corrected version of the preceding line of code:echo “This works!”。You may notice that leaving the semicolon off a single statement doesn’t cause PHP to display an error message. This is a feature of PHP to make it easier to insert a single echo statement. To see the error when you try to run the first echo statement, copy the statement to two separate lines so it looks like this:echo “This won’t work.”echo “This won’t work.”The code will not run and PHP will return an error because there isn’t a semicolon separating the statements.5 How Embedded Programming WorksBefore now, I’ve only mentioned that PHP code must be enclosed in the ?php and ? PHP tags. Using tags to separate PHP code and HTML code within the same file allows programming code to be mixed directly with information that is going to be sent to the browser just as it is. This makes PHP an embedded programming language because PHP code is embedded directly in HTML code.This concept is relatively new: Before languages like PHP, programs had no real need to display data using a structured formatting language as plex as HTML. Information displayed on the screen was usually just letters, numbers, and spaces, without many colors, sizes, or other formatting markups.Since PHP was made for Web programming, it is intended to be used with HTML, which significantly increases the amount of information that has to be sent back to the browser. Not only does PHP have to send back the information the user sees, but also the markup tags required to format the information correctly.To make the mixing of information and markup tags simpler, PHP code is embedded directly in the HTML page where the information is desired. The example at the beginning of this chapter demonstrates this concept quite clearly。 the program is mostly regular HTML code, but PHP is also used to insert some information.Embedded programming will make your job as a programmer much easier。 you can add programming where you need it and use regular HTML the rest of the time. However, be sure to enclose your PHP code in PHP tags or your code will not be parsed, but rather displayed on the HTML page.The following program provides another example of embedded programming:?php/* File: – displays “Hello, World!” */?htmlheadtitleHello, World!/title/headbody bgcolor=”white” text=”black”Hello,?php// Send “World!” to the visitor’s browserecho “World!”。?/body/htmlWhen this file is accessed through a Web server, the PHP interpreter will process the file line by line from the top to bottom. Thus, the information before the opening PHP tag is sent to the browser, along with the result of the echo statement. The Web browser receives an HTML file that looks like this:htmlheadtitleHello, World!/title/headbody bgcolor=”white” text=”black”Hello, World!/body/htmlThe browser then displays the file just as it would any other HTML file.6 Serverside Versus Clientside ScriptingAs already explained, PHP code is processed at the Web server before anything is returned to the browser. This is referred to as serverside processing. Most Web programming works this way: PHP, ASP, Perl, C, and others.However, a few languages are processed by the browser after it receives the page. This is called clientside processing. The most mon example of this is JavaScript.This can lead to an interesting problem with logic. The following example demonstrates what I mean:script language=”JavaScript”if (testCondition()){?phpecho “bThe condition was true!/b”。?} else {?phpecho “bThe condition was not true./b”。?}/scriptMany times the programmer of such a segment expects only one of the echo statements to execute. However, both will execute, and the page will be left with JavaScript that will generate errors (because the information in the echo statements is not valid JavaScript code). If this is a little unclear, read on。 the following demonstration should clear things up for you. The resulting code from the previous snippet follows。 notice that the JavaScript has been left intact and untouched, but the PHP code has been evaluated. PHP ignores the JavaScript code pletely:script language=”JavaScript”if (testCondition()){bThe condition was true!/b} else {bThe condition was not true./b}/scriptAs you can see, this code will cause JavaScript errors when executed. Be cautious when bining PHP and JavaScript code: It can be done, but it must be done with attention to the fact that the PHP will always be evaluated without regard for the JavaScript. To successfully bine the two, it’s generally necessary to output JavaScript code with PHP.The following example does just that:script language=”JavaScript”if (testCondition()){?phpecho “(‘bThe condition was true!/b‘)。”。?} else {?phpecho “(‘bThe condition was not true./b‘)?!薄?}/script7 Running Your New ProgramFollowing the same procedure outlined at the beginning of this article, try running this program.Your program display “Hello, World!” in your browser.
點(diǎn)擊復(fù)制文檔內(nèi)容
外語相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1