首页 PHP毕业设计英文文献翻译

PHP毕业设计英文文献翻译

举报
开通vip

PHP毕业设计英文文献翻译PHP毕业设计英文文献翻译 本科毕业设计(论文) 外文参考文献译文及原文 学 院 信息工程学院 专 业 信息工程(电子信息工程方向) 年级班别 2004级(4)班 学 号 3104002975 学生姓名 陈英权 指导教师 刘喜英 2008 年 6 月 5 日 外文参考文献译文 1 为什么选择PHP ......................................... 错误!未定义书签。 2 如果你是编程新手 ...................................... 错误!未定义书签...

PHP毕业设计英文文献翻译
PHP毕业设计英文文献翻译 本科毕业设计(论文) 外文参考文献译文及原文 学 院 信息工程学院 专 业 信息工程(电子信息工程方向) 年级班别 2004级(4)班 学 号 3104002975 学生姓名 陈英权 指导教师 刘喜英 2008 年 6 月 5 日 外文参考文献译文 1 为什么选择PHP ......................................... 错误!未定义 关于书的成语关于读书的排比句社区图书漂流公约怎么写关于读书的小报汉书pdf 签。 2 如果你是编程新手 ...................................... 错误!未定义书签。 3 写一个基本的PHP程序 .................................. 错误!未定义书签。 4 编程语法 .............................................. 错误!未定义书签。 5 嵌入式语言如何工作 .................................... 错误!未定义书签。 6 服务端和客户端脚本 .................................... 错误!未定义书签。 7 运行你的程序 .......................................... 错误!未定义书签。 外文参考文献原文 1 Why PHP? ............................................... 错误!未定义书签。 2 If You Are New to Programming .......................... 错误!未定义书签。 3 Writing a Basic PHP Program ............................ 错误!未定义书签。 4 Programming Syntax ..................................... 错误!未定义书签。 5 How Embedded Programming Works ......................... 错误!未定义书签。 6 Server-side Versus Client-side Scripting ............... 错误!未定义书签。 7 Running Your New Program .............................. 错误!未定义书签。 1 为什么选择PHP 对于Web编程来说,PHP是一个很好的选择。它较其它语言(包括其它面向Web的语言)有许多优点。为了得到一个清晰的理解(和常见的面向Web的语言相比),让我们将它们比较一下。 ASP是微软的网络开发环境(它本身不是一门开发语言,因为它允许程序员在ASP中选择其它语言进行开发,如VBScript或JScript。)ASP虽然简单,但它太过于简单了,以至于不能使用更复杂的逻辑和算法。 除了ASP的过分简单,很多公司发现很难在微软的ASP许可证上节约成本。即使不考虑硬件成本,微软的Web服务器就要数千美元,而基于UNIX操作系统的、可运行PHP的Web服务器则是免费的。 另一种Web使用的知名语言是Sun Microsystems公司的Java。Java是平台独立的语言(在一个系统上用Java开发的程序可以不经过任何修改,就可以运行在其它系统上)。 尽管Java的确有它的优点,但它在开发时间、开发成本和执行速度上却有明显的劣势。Java开发是耗时的,因为Java工程要遵循严格的规则(Java强制的),这需要进行大量的规划。另外,Java开发周期长,费用成本高, Java程序员的待遇也较高。因此Java程序开发的成本远远高于其它语言开发的成本。通过我们的比较可以看出,即使项目开发结束后,以Java语言写的程序在运行时所花费的时间比其它语言的时间还要长。 总的来说,和Java相比,PHP的 关于同志近三年现实表现材料材料类招标技术评分表图表与交易pdf视力表打印pdf用图表说话 pdf 现很出色。一个相似的工程以PHP语言开发,要比用Java开发节省两三倍的时间。最重要的是,虽然最终的程序都可以运行多种平台上(如Java),而PHP的程序则运行的更快。 另一种开发Web程序的常用语言是Perl。Perl与PHP一样,是一个可运行在多个平台上的开源项目。事实上,Perl的历史远远要比PHP长。在PHP之前,Perl被认为是最好的Web开发语言。然而,在过去的几年中,在Web开发领域,PHP赢得了比Perl更好的口碑。因为PHP语言本身集成了大量的功能模块,而要在Perl中使用这些功能,你就不得不单独下载许多额外的功能模块。这样,当程序从一个系统转移到另一个系统时,就会容易产生问 快递公司问题件快递公司问题件货款处理关于圆的周长面积重点题型关于解方程组的题及答案关于南海问题 ,因为Perl不得不从自己的CPAN上下载相应的功能模块。 最后要比较的语言是C。C语言已经存在很长的时间了;它已被用在各种各样的计算机中,从大型主机到个人PC都可见到它的身影。如果你了解C语言的话,你就会知 道用C语言开发Web程序会存在一些问题。为了用C语言开发一个Web程序,在你着手构思你的实际任务时,你将不得不着手实现所有Web程序本身就应该具备的功能(如采集HTML表单提交的数据)。而PHP语言提供了所有的Web常用或者并不是很常用的功能,可以允许程序员将更多的精力放在实际的任务中。 就其它的Web开发语言与PHP语言之间的比较而言,它们之间还存在很多不同。在Internet上将PHP与Java,Perl,ASP等语言进行比较的文章也很多。但是一旦你拥有了PHP的编程经验,你可能就会发现,在选择开发语言时,你会努力的说服你的客户或老板,允许你使用PHP来进行开发,而不是选择其它的语言。如果出现问题,你可以通过搜索Internet找到大量基于这些问题的有用信息。 PHP的使用是没有限制的。早期的版本使用的是单独的跟踪程序。而随着时间的推移,这个简单的跟踪程序已经被包含在语言的内部了。 PHP的主要用途,当然不只是用来跟踪的了;它还可以做许多其它的事情。为了让你理解PHP可以做什么,下面介绍了一些PHP的常见用途: ? 反馈表单 ? 购物车和其它类型的电子商务系统 ? 用户注册,访问控制,以及在线订阅服务 ? 客户登记 ? 讨论和留言板 2 如果你是编程新手 如果你是一个从来没有写过程序的新手,这个想法可能有点吓人。大多数程序员可能会告诉你(如果他们愿意承认),他们刚开始学习编程的时候,也有点无从下手。然而,编程的过程根本不是那么难,相反却很享受,因为你不需要有多高的智商来适应它。 当你写程序的时候,你的主要目的就是把你的想法翻译成计算机能够识别的语言。例如,如果你是教人如何做汉堡包,你会首先描述将牛肉做成牛肉饼的过程。然后,你会告诉他如何把汉堡包放在烤架上,烤多长时间,最后,如何把它们拿下来。 当然,仅仅因为你能描述制作汉堡包的过程,并不意味着PHP能够在任何时间、任何地点为你做任何事情。重点是,如果你能像我刚才描述制作汉堡包的过程那样,描 表格和图片等,就请继续插入这些内容,保存,并关闭WYSIWYG编辑器。 现在,在记事本中打开该文件,看看你的PHP代码是否发生了变化,包括代码格式上的改变,特殊字符的转换(如< <;)以及完全被删除的代码。 你可能会发现PHP代码被以某种方式改变了。因为PHP代码对一些WYSIWYG编辑器导致的变化是敏感的,如果你在写PHP代码的时候,使用WYSIWYG编辑器,这就很难让人理解了。PHP社区不会因为这个原因,而建议你不要使用WYSIWYG编辑器,因为使用这样的编辑器有时还是可以加快程序的开发速度的。 现在,当你读代码或者测试本文中的程序时,请试着习惯使用这些纯文本编辑器吧。当你习惯使用纯文本编辑器的时候,再使用其它的编辑器,那就容易上手的多了。到那时,你就可以识别出编辑器自身生成的代码,也就能更容易的找出提高你工作效率的 方法 快递客服问题件处理详细方法山木方法pdf计算方法pdf华与华方法下载八字理论方法下载 了。 不管你现在处理PHP代码的编辑器是什么,如果你正在用的是WYSIWYG编辑器,我建议你使用如记事本这样的纯文本编辑器,或者一些带有语法加亮功能的纯文本编辑器。这些编辑器可以保证你的代码就像刚输入时的一样(WYSIWYG编辑器倾向于以它自己的规则来格式化你的代码,而这种功能对于编辑PHP代码来说并不需要)。即使你的编辑器没有改变你的PHP代码,但如果它不是一个严格基于文本的编辑器,仍然会在随后的运行中可能会出现问题。 这是创建和浏览HTML文件的一般过程: 1.创建HTML文件(添加文本,表格,图像,或声音等)。 2.保存HTML文件,命名为filename.html。 3.用FTP程序把你的文件上传到Web服务器。 4.用你的浏览器访问Web服务器上的文件(如,http:/ / www.example.com /filename.html)。 创建PHP程序的过程大致与创建HTML文件的过程相同: 1.创建HTML文件(包含文字,表格,图像,或声音),并在适当的位置插入PHP代码。 2.保存PHP文件,命名为filename.php。 3.使用FTP程序上传你的文件到Web服务器。 4.用你的浏览器访问Web服务器上的文件(如http:/ / www.example.com /filename.php)。 可见,创建PHP程序和创建常规HTML程序的过程没有多大不同。 在了解了创建PHP程序的大致过程后,请看一下你的第一个PHP程序。看过代码你将了解,如何将PHP文件与普通的HTML文件相区分,如何把它上传到你的Web服务器上,以及在浏览器中页面看起来应该是什么样的。 PHP

PHP

这个文件看起来和一个普通的HTML文件很像。注意,文件中包含了典型的HTML标签。事实上,如果你忽略标签间的内容,你也可以把该文件重新命名为.html的后缀名。 然而,这个文件的确包含了PHP代码,所以它必须被命名为.php后缀名。PHP代码在两个PHP标签之间(()),如图1.1所示。PHP标签之间的命令是“echo”(PHP的关键字,意思是“显示文本”)随后跟的是要显示的文本。结果很快被显示出来,“echo”后面的文本看起来就像是包含在HTML文件本身一样,似乎就没有PHP代码存在过。 图1.1:这幅图显示了一个基本的PHP程序的不同部分。 在看输出的结果之前,我们先把这个文件上传到Web服务器上并且运行。按照上面写PHP程序的过程,将它保存为PHP文件(.php后缀名),并上传到你的Web服务器。 一旦你的程序被上传到您的Web服务器,在你的浏览器中输入该文件地址。你应该得到一个返回的页面,它看起来应该非常类似如下的截图。 图1.2:当你访问你的程序时应该看到这样的页面。 4 编程语法 当你访问刚刚上传的PHP程序时,该PHP程序在返回浏览器之前是经历了一个复杂的过程的。PHP文件中的相关命令就是在这个过程中被执行的;在这个例子中,是一个单独的echo语句。图1.3显示当PHP文件发送请求时历经的过程。 图1.3:不像HTML文件,PHP文件在被返回浏览器时执行了文件中包含 的PHP命令。 PHP解释器(或解析器)程序,正如上图中看到的那样。它读取PHP程序并执行它所能理解的命令。(如果PHP碰巧遇到一个它不能理解的命令,它会停止继续解析该文件,并返回一个错误消息给浏览器。) 每当PHP在给Web服务器发送请求时,该PHP解释器在给浏览器反馈信息前,必须先处理PHP文件中的命令。因为PHP的每次运行,都必须调用相关的例程,以便执行这些命令。 这和编译型语言有所不同,如C或C + +,它们只被解释一次;C语言程序,直接被翻译成机器码(机器码直接由CPU处理)。PHP不得不解释程序中包含的命令,这些命令还在必须以PHP能够识别的形式给出。例如,如果有人走向你,用德语询问时间,你可能不知道他在说什么(除非你懂得德语或者这个人指着他的手腕)。同样地,如果我走到你面前说,用英文语美味问你,“现在几点了?“你可能也不知道我在说什么。 PHP也有类似的限制。语句(命令的集合,由特定字符组成,PHP能够识别的句子)必须以正确的命令格式给出。例如,你要在PHP中显示一条文本,你必须使用PHP能够识别的命令,如“echo”。同时,你必须把你的单词,以正确的顺序,用英语讲给别人。还要格式化要传递给PHP执行的语句,以便PHP解释器能够识别并执行。 语法,就是将PHP能够理解并执行的句子组织到一起的过程中要遵循的规则,这 例子比较清楚的演示了这一概念;程序里大部分是常规的HTML代码,但PHP也会插入一些适当的信息到页面中。 嵌入式编程,将使程序员的工作更为便捷;你可以在任何你想要插入代码的地方插入PHP代码,剩下的地方就写常规的HTML代码了。然而,别忘了用PHP标签封装你的PHP代码,否则你的代码将不能被解析,而是会被直接显示在HTML页面上。 下面的程序演示了一个嵌入式编程的例子: Hello, World! Hello, 当Web服务器访问这个文件的时候,PHP解释器将会从头到尾的逐行执行文件中的命令。因此, PHP标签间处理的信息就随着echo语句一起返回给浏览器了。Web浏览器接收到的内容和如下代码所示效果相同: Hello, World! Hello, World! 然后浏览器就可以像显示其它HTML文件一样显示“Hello World!”信息了。 6 服务端和客户端脚本 就像先前解释的一样,在信息返回浏览器之前,PHP代码要在Web服务器端执行,这被称为服务器端处理。大多数的Web编程都是以这种形式存在的:像ASP、PHP、Perl、C等。 然而,还有一些语言是在浏览器接收到返回的页面时进行处理的。这就是所谓的客户端处理。最常见的例子就是JavaScript。 这可能会导致逻辑上的一个有趣的问题。下面的示例演示了这种情况: 多数情况下,这么写代码的程序员通常希望只有一个echo语句被执行。然而,这两句都将执行,页面将停留在生成错误的JavaScript页面(因为echo语句中的信息不是有效的JavaScript代码)。如果你还不是很清楚,继续看下面的例子;如下的代码会让你更加明确。这段代码是从以前的代码片段中摘录下来的,注意JavaScript是原封不动的,但PHP代码已经被调用了。PHP完全忽略了JavaScript代码: 正如你所看到的,这会导致JavaScript执行时的错误。将PHP和JavaScript代码混合使用要小心:可以这样做,但是要注意,PHP将永远无视JavaScript的存在。为了成功地将二者结合起来,用PHP输出JavaScript代码是非常必要的。 下面的例子就是这么做的: 7 运行你的程序 按照本文开始介绍的过程,尝试运行这个程序。 你将在你的浏览器里看到 “Hello World!“。 1 Why PHP? PHP is an excellent choice for Web programming. It has many advantages over other languages, including other Web-oriented languages. To get a very general understanding of how the common Web programming languages compare, let?s compare them. ASP is Microsoft?s Web programming environment. (It?s not a language itself because it allows the programmer to choose from a few actual languages, such as VBScript or JScript.) ASP is simple, but too simple for programs that use complex logic or algorithms. Besides ASP?s over-simplicity, many companies find it hard to budget for the expense of Microsoft licenses. Without even considering hardware costs, a Microsoft server could cost thousands of dollars in licensing, whereas a comparable Unix-based operating system running PHP could be free. Another language well known for its use on the Web is Sun Microsystems? Java. Java is praised for being platform-independent (a program written in Java can be run on virtually any computer without having to make any modifications to the program). Although Java does have its advantages, it has serious downsides in development time, development cost, and execution speed. Java development is time-consuming because projects in Java must follow strict rules (imposed by Java) that require extensive planning. In addition to high development time, the cost is also high because Java developers are expensive to hire. The cost is therefore potentially much higher than it would be if the project were done in another language. Even after the project is built, a program written in Java takes longer to run than one written in one of the other languages to which we?re comparing. Overall, when compared to Java, PHP comes out with flying colors. It is not tracking program evolved into a language of its own. PHP?s primary use certainly isn?t to track resumes anymore; it has grown to be able to do that and just about anything else. To give you a better idea of what PHP can do, here are some of its common uses: ? Feedback forms ? Shopping carts and other types of e-commerce systems ? User registration, access control, and management for online subscription services ? Guest books ? Discussion and message boards 2 If You Are New to Programming If you?ve never written a computer program before, the whole idea may be quite intimidating. Most programmers will probably tell you (if they aren?t embarrassed to admit it) that they were intimidated when they began. However, the programming process isn?t all that difficult and, contrary to popular belief, you don?t have to have an extremely high IQ to be good at it. When you write a program, your main goal is to translate your idea into a language that the computer can understand. For example, if you were teaching a person how to cook hamburgers, you would first describe the process of forming the ground beef into patties. Then, you would tell the person how to put the burgers on the grill, how long to leave them there, and finally how to remove them. Of course, just because you can describe the process of making hamburgers doesn?t mean PHP is going to be cooking anything for you anytime soon. The point is, if you can describe a process like I just described making hamburgers, you can write a program. Writing a PHP program is simply the process of describing to PHP how to do something. By the time you?ve finished reading this article, you will understand all the concepts behind writing a PHP program. Those concepts are like the words and sentences used to describe hamburgers. The more you read this article, the more “words” you will understand, and the better you will be able to “describe” your task to PHP. Thus, you will learn to write PHP programs to suit whatever need or idea you have, and soon it won?t be any more intimidating than telling someone how to cook hamburgers. Some programming problems might be very complex when examined as a whole. For example, creating a shopping cart is definitely not a simple task. However, a shopping cart can be broken into a few smaller tasks. Those tasks might include adding and removing items, which are both tasks that can break into even smaller tasks. You will find that any task, no matter how complex, can be broken into smaller ones until each task is simple enough that breaking it down further is unnecessary. This process is explained in more detail when you begin creating programs with more complexity 3 Writing a Basic PHP Program Before we get into an actual program, let?s take a look at the steps we?ll take to create one. The steps aren?t complicated; in fact, they?re basically the same as the steps you use when creating an HTML page and publishing it to your server. Unlike creating an HTML page, creating a PHP program requires that you actually work with the source code of the file as opposed to a “what you see is what you get” (WYSIWYG) approach. If you?re used to using a WYSIWYG program (such as Microsoft FrontPage, Macromedia Dream-Weaver, or Microsoft Word), it may take you some time to get used to looking at the source code. The good news is there?s no reason that you can?t continue to use a WYSIWYG editor to create an HTML design for your program. However, you may be disappointed to find that many WYSIWYG editors mangle or even delete vital PHP code from your files. For this reason, it is important to find out how your particular editor handles PHP code. If you want to test your WYSIWYG to see how it handles PHP code, create a new file, naming it with a .php extension. Then, switch to your editor?s source view or open the file in a separate program, such as Notepad and enter the program shown in the first example later in the chapter, making sure not to make any mistakes. When you?re finished, save the file and switch back to the WYSIWYG editor. If you see your PHP code, work around it and type a few lines of text. If you want, add some common elements that you include in your Web pages, such as tables and images. Save the file again and close all the open editors. Now, open the file in Notepad and look at the PHP code. Look for any changes, including changes in the way the code is formatted, special characters that have been converted into codes (such as < to <), and code that has been completely removed. You will probably find that the PHP code has been changed in some way. Because PHP is sensitive to some of the changes a WYSIWYG editor might make, it?s almost impossible to use a WYSIWYG editor once you?ve started adding PHP code. The PHP community won?t tell you that using a WYSIWYG editor is a sign of weakness; doing so can speed things up a lot sometimes. For now, try using a plain-text editor when you?re reading and experimenting with the examples in this article. When you?re comfortable with that, feel free to try it with whatever editor you want. By that time, you?ll be able to recognize code that the editor has mangled, and you?ll have an easier time finding what works best for you. Regardless of how your current editor handles PHP code, if you are using a WYSIWYG editor, I suggest that you use an editor such as Notepad or one of the many free syntax-highlighting editors out there. Using one of these programs will ensure that your code stays just as you typed it (WYSIWYG editors tend to reformat things as they see fit, which isn?t desirable when coding PHP). Even if your editor passed the test, if it?s not a strictly text based (not WYSIWYG) editor, you might find yourself running into problems later. Here is the process you might use in creating and viewing an HTML file: 1. Create your HTML file (add text, tables, images, or sounds). 2. Save your HTML file as filename.html. 3. Use an FTP program to upload your file to the Web server. 4. Point your browser to the address of the file on your Web server (for example, http://www.example.com/filename.html). The process you would use to create a PHP program is much the same: 1. Create your HTML file (containing text, tables, images, or sounds) and insert PHP code where desired. 2. Save your PHP file as filename.php. 3. Use an FTP program to upload your file to the Web server. 4. Point your browser to the address of the file on your Web server (such as http://www.example.com/filename.php). The process of creating a PHP program isn?t much different from the process you follow to create a regular HTML page. Now that you?ve seen the overall process, let?s take a look at our first PHP program. After reading the following example, you?ll learn what separates it from a normal HTML file, how to upload it to your Web server, and what the page should look like viewed in your browser. PHP

PHP

This file looks a lot like a regular HTML file. Notice that the file has HTML Figure 1.2: This is what you should see in your browser when you go to the address of your new program. 4 Programming Syntax When you accessed the program you just uploaded with your browser, the PHP program went through a process before it was returned to the browser. The process performed the PHP commands within the file; in this case, that was a single echo statement. Figure 1.3 shows what happens when a request is made for a PHP file. Figure 1.3: Unlike HTML files, PHP files are routed through a special process that performs the PHP commands within the file before it is returned. The PHP interpreter (or parser) is the program that performs the processing mentioned previously. It reads the PHP program file and executes the commands it understands. (If PHP happens to find a command it doesn?t understand, it stops parsing the file and sends an error message back to the browser.) Every time a request for a particular PHP file is made to a Web server, the PHP interpreter must process the file prior to returning anything to the browser. Because PHP must interpret a PHP program every time that program runs, it is known as a scripting language. This is quite different from a compiled language, such as C or C++, which is only interpreted from a human-readable form once; a C program is simply translated into machine code (code that is processed directly by the computer?s processor). Since PHP has to interpret the commands included within a program, the commands must be given in such a way that PHP understands them. For example, if someone walked up to you and asked you in German for the time, you probably wouldn?t know what he was talking about (unless you know German or the person pointed to his wrist). Likewise, if I walked up to you and said, “Is time it what?” you probably wouldn?t know what I was talking about, even though I used English words. PHP has similar limitations. A statement (the construction of commands and certain characters to make a sentence that PHP will understand) must be given using the correct commands. For example, the command show text has no meaning in PHP; you must instead use a command PHP recognizes, such as echo. Also, just as you must put your words in the correct order to talk to another person in English, you must format the statements you give PHP so that they follow the format PHP expects. Syntax, then, is the process of putting together statements that PHP will beable to interpret and carry out. Examples of this are PHP?s opening and closing tags. PHP only parses code that is 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 command 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 come 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 Works Before now, I?ve only mentioned that PHP code must be enclosed in the 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 complex 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: Hello, World! Hello, When 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: Hello, World! Hello, World! snippet follows; notice that the JavaScript has been left intact and untouched, but the PHP code has been evaluated. PHP ignores the JavaScript code completely: As you can see, this code will cause JavaScript errors when executed. Be cautious when combining 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 combine the two, it?s generally necessary to output JavaScript code with PHP. The following example does just that: 7 Running Your New Program Following the same procedure outlined at the beginning of this article, try running this program. Your program display “Hello, World!” in your browser. 本科毕业设计(论文) 外文参考文献译文及原文 学 院 信息工程学院 专 业 信息工程(电子信息工程方向) 年级班别 2004级(4)班 学 号 3104002975 学生姓名 陈英权 指导教师 刘喜英 2008 年 6 月 5 日 外文参考文献译文 1 为什么选择PHP ......................................... 错误!未定义书签。 2 如果你是编程新手 ...................................... 错误!未定义书签。 3 写一个基本的PHP程序 .................................. 错误!未定义书签。 4 编程语法 .............................................. 错误!未定义书签。 5 嵌入式语言如何工作 .................................... 错误!未定义书签。 6 服务端和客户端脚本 .................................... 错误!未定义书签。 7 运行你的程序 .......................................... 错误!未定义书签。 外文参考文献原文 1 Why PHP? ............................................... 错误!未定义书签。 2 If You Are New to Programming .......................... 错误!未定义书签。 3 Writing a Basic PHP Program ............................ 错误!未定义书签。 4 Programming Syntax ..................................... 错误!未定义书签。 5 How Embedded Programming Works ......................... 错误!未定义书签。 6 Server-side Versus Client-side Scripting ............... 错误!未定义书签。 7 Running Your New Program .............................. 错误!未定义书签。 1 为什么选择PHP 对于Web编程来说,PHP是一个很好的选择。它较其它语言(包括其它面向Web的语言)有许多优点。为了得到一个清晰的理解(和常见的面向Web的语言相比),让我们将它们比较一下。 ASP是微软的网络开发环境(它本身不是一门开发语言,因为它允许程序员在ASP中选择其它语言进行开发,如VBScript或JScript。)ASP虽然简单,但它太过于简单了,以至于不能使用更复杂的逻辑和算法。 除了ASP的过分简单,很多公司发现很难在微软的ASP许可证上节约成本。即使不考虑硬件成本,微软的Web服务器就要数千美元,而基于UNIX操作系统的、可运行PHP的Web服务器则是免费的。 另一种Web使用的知名语言是Sun Microsystems公司的Java。Java是平台独立的语言(在一个系统上用Java开发的程序可以不经过任何修改,就可以运行在其它系统上)。 尽管Java的确有它的优点,但它在开发时间、开发成本和执行速度上却有明显的劣势。Java开发是耗时的,因为Java工程要遵循严格的规则(Java强制的),这需要进行大量的规划。另外,Java开发周期长,费用成本高, Java程序员的待遇也较高。因此Java程序开发的成本远远高于其它语言开发的成本。通过我们的比较可以看出,即使项目开发结束后,以Java语言写的程序在运行时所花费的时间比其它语言的时间还要长。 总的来说,和Java相比,PHP的表现很出色。一个相似的工程以PHP语言开发,要比用Java开发节省两三倍的时间。最重要的是,虽然最终的程序都可以运行多种平台上(如Java),而PHP的程序则运行的更快。 另一种开发Web程序的常用语言是Perl。Perl与PHP一样,是一个可运行在多个平台上的开源项目。事实上,Perl的历史远远要比PHP长。在PHP之前,Perl被认为是最好的Web开发语言。然而,在过去的几年中,在Web开发领域,PHP赢得了比Perl更好的口碑。因为PHP语言本身集成了大量的功能模块,而要在Perl中使用这些功能,你就不得不单独下载许多额外的功能模块。这样,当程序从一个系统转移到另一个系统时,就会容易产生问题,因为Perl不得不从自己的CPAN上下载相应的功能模块。 最后要比较的语言是C。C语言已经存在很长的时间了;它已被用在各种各样的计算机中,从大型主机到个人PC都可见到它的身影。如果你了解C语言的话,你就会知 道用C语言开发Web程序会存在一些问题。为了用C语言开发一个Web程序,在你着手构思你的实际任务时,你将不得不着手实现所有Web程序本身就应该具备的功能(如采集HTML表单提交的数据)。而PHP语言提供了所有的Web常用或者并不是很常用的功能,可以允许程序员将更多的精力放在实际的任务中。 就其它的Web开发语言与PHP语言之间的比较而言,它们之间还存在很多不同。在Internet上将PHP与Java,Perl,ASP等语言进行比较的文章也很多。但是一旦你拥有了PHP的编程经验,你可能就会发现,在选择开发语言时,你会努力的说服你的客户或老板,允许你使用PHP来进行开发,而不是选择其它的语言。如果出现问题,你可以通过搜索Internet找到大量基于这些问题的有用信息。 PHP的使用是没有限制的。早期的版本使用的是单独的跟踪程序。而随着时间的推移,这个简单的跟踪程序已经被包含在语言的内部了。 PHP的主要用途,当然不只是用来跟踪的了;它还可以做许多其它的事情。为了让你理解PHP可以做什么,下面介绍了一些PHP的常见用途: ? 反馈表单 ? 购物车和其它类型的电子商务系统 ? 用户注册,访问控制,以及在线订阅服务 ? 客户登记 ? 讨论和留言板 2 如果你是编程新手 如果你是一个从来没有写过程序的新手,这个想法可能有点吓人。大多数程序员可能会告诉你(如果他们愿意承认),他们刚开始学习编程的时候,也有点无从下手。然而,编程的过程根本不是那么难,相反却很享受,因为你不需要有多高的智商来适应它。 当你写程序的时候,你的主要目的就是把你的想法翻译成计算机能够识别的语言。例如,如果你是教人如何做汉堡包,你会首先描述将牛肉做成牛肉饼的过程。然后,你会告诉他如何把汉堡包放在烤架上,烤多长时间,最后,如何把它们拿下来。 当然,仅仅因为你能描述制作汉堡包的过程,并不意味着PHP能够在任何时间、任何地点为你做任何事情。重点是,如果你能像我刚才描述制作汉堡包的过程那样,描
本文档为【PHP毕业设计英文文献翻译】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_594905
暂无简介~
格式:doc
大小:22KB
软件:Word
页数:18
分类:
上传时间:2017-06-11
浏览量:106