PHP versus ASP
Thu, Aug 17, 2000; by John Lim.
序:
微软的ASP是一项强大的动态WEB页面技术,我已经使用了一年的ASP,用它创建了许多的WEB站点,但是现在我的公司正想转向另一项叫PHP的INTERNET技术,来进行以后的WEB站点开发。
问题是我们已经习惯于使用ASP,并且喜欢用它,为什么我们要转向PHP呢?
开放源码运动
首先,我们认识到,开源运动使我们获得了强大的技术支持和免费的代码供应。例如:在ASP中,上传文件、加密密码、发送邮件都需要第三方的商业软件的支持,是要收费的;但在PHP中,这一切是免费的!
但这还不足以说服我们转向PHP,因为我们已经投入了大量的时间和金钱在这些必需的商业软件工具上。
INTERNET程序和LINUX
我有一个梦想,我希望在将来每一个程序都是一个INTERNET程序。不用再需要购买软件包,不要再去安装它,它们能在INTERNET上得到,并且已经是安装好的,我们只要在浏览器中运行程序,这不会需要太多的配置。
大部分的网络应用程序都运行在LINUX和PHP上。它们通常不使用ASP,有一种软件叫Chilisoft ASP,它能在LINUX上运行ASP,但它是要钱的,同时它也不支持最新版的ASP,更重要的是创建高性能ASP站点所用的好的第三方DLL都不能运行在LINUX上。
于是,为了实现我们的INTERNET软件梦想,我们决定寻找一种更好的,接近于ASP的技术来替代它!
ISAPI的支持
ZEND团队正在开发的PHP核心引擎中就包括一个ISAPI引擎。
ISAPI是一种MICROSOFT的INTERNET WEBSERVER API,它的应用,使我们这些习惯于在WINDOWS下开发程序的程序员有了一条通向LINUX的捷径。
技术分析
每个人都声称自己的产品最快,这不是我真正关心的---我只关心“足够快”,对我来说,PHP足够快!
ASP支持多种程序语言。这种体系使得程序天生就带有慢和多内存占用,它的每一种语言解析就相当于一个PHP编译,(就是说,当ASP开始解析一条代码时,它相当于同时开动多个PHP),当ASP解析到一个ASP开始标记(同时,ZEND打算发布一个可以保护我们源代码的编译器,以及各种不同的优化技术(Zend Cache and Optimizer),甚至于实现PHP在WINDOWS下的良好应用,无疑,PHP在这一方面又将强于ASP!
一个使用PHP的商业决定
相对于PHP来说,这里有许多其它的开放源码选择,比如说perl,python/zope and jsp/tomact。对我来说,PHP最接近于ASP,同时也易于转换!
Perl: 一种不适用于大项目的语言.
Python/Zope:一种很好的语言,但它的体系不如PHP那般的接近ASP.
JSP/Tomcat: 我认为,比起脚本语言来,type-safe, type-bound, type-checking Java 不太好操作!
代码
我们注意到,我们用PHP开发的代码比用ASP开发的要短,这是因为,在PHP中HTTP GET和POST变量自动创建为全局变量,这样我们就不要再花费太多的时间去分析ASP REQUEST对象了。
同时PHP的include()函数非常好,我们能有条件的include代码,以使我们的代码尽量精简,更加易懂!
PHP有着相似于ASP的COOKIE和SESSION管理功能。
结论:
我现在还在使用PHP,在所有的地方使用“$”这个符号,它是非常酷的,同时它也是我最喜欢的一个符号!:)

Load balancing affects session management, but can be resolved with session replication, session stickiness, and centralized session storage. 1. Session Replication Copy session data between servers. 2. Session stickiness directs user requests to the same server. 3. Centralized session storage uses independent servers such as Redis to store session data to ensure data sharing.

Sessionlockingisatechniqueusedtoensureauser'ssessionremainsexclusivetooneuseratatime.Itiscrucialforpreventingdatacorruptionandsecuritybreachesinmulti-userapplications.Sessionlockingisimplementedusingserver-sidelockingmechanisms,suchasReentrantLockinJ

Alternatives to PHP sessions include Cookies, Token-based Authentication, Database-based Sessions, and Redis/Memcached. 1.Cookies manage sessions by storing data on the client, which is simple but low in security. 2.Token-based Authentication uses tokens to verify users, which is highly secure but requires additional logic. 3.Database-basedSessions stores data in the database, which has good scalability but may affect performance. 4. Redis/Memcached uses distributed cache to improve performance and scalability, but requires additional matching

Sessionhijacking refers to an attacker impersonating a user by obtaining the user's sessionID. Prevention methods include: 1) encrypting communication using HTTPS; 2) verifying the source of the sessionID; 3) using a secure sessionID generation algorithm; 4) regularly updating the sessionID.

The article discusses PHP, detailing its full form, main uses in web development, comparison with Python and Java, and its ease of learning for beginners.

PHP handles form data using $\_POST and $\_GET superglobals, with security ensured through validation, sanitization, and secure database interactions.

The article compares PHP and ASP.NET, focusing on their suitability for large-scale web applications, performance differences, and security features. Both are viable for large projects, but PHP is open-source and platform-independent, while ASP.NET,

PHP's case sensitivity varies: functions are insensitive, while variables and classes are sensitive. Best practices include consistent naming and using case-insensitive functions for comparisons.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.
