Question:
what is the basic difference between ASP and PHP?
2012-03-23 22:12:03 UTC
i know both are server side scripting languages but what is the basic difference. also knindly tell the advantages and dis-advantages of one over the other.
Five answers:
peteams
2012-03-24 00:22:05 UTC
The two take different approaches to creating web pages.



In a PHP based solution you mix HTML and PHP together. A language processor then converts the HTML code into print statemends and the resulting pure-PHP is then executed to write out the HTML for the page.



ASP.NET can be used like PHP, because that is the way traditional web developers think. However the intended way is different.



In ASP.NET you design your page in an extended and extensible version of HTML. The page is then seen as an object model which is parsed, along the way calling into business logic.



For small scale development PHP has the advantage that is is well known and straightforward. You take your static HTML document and for dynamic content insert PHP wrapped in .



ASP.NET is designed for larger scale reusable development. You take your static HTML document and insert placeholders where the dynamic content will appear, these placeholders are then populated by the code behind. That code behind can be written in C#, Visual Basic or even SQL.



PHP therefore mixes HTML and code together and the two must be tested together. ASP.NET keeps HTML and code separate, which means the code can be tested in isolation and more easily reused elsewhere.
?
2012-03-23 23:57:55 UTC
ASP isn't a scripting language itself, unlike PHP. These days, ASP pages can be written in languages such as Visual Basic and C#. The drawback is that ASP pages generally need to be ran on a Windows based server and PHP runs happily on the various Linux/Unix releases.
nazirula
2012-03-23 22:32:06 UTC
Price

There is a very large difference between PHP and ASP in terms of price. PHP is free. On the other hand, ASP requires both initial and ongoing costs for maintenance and debugging. Furthermore, any additional ASP libraries will also come with a price tag.



Platform Compatibility

PHP runs on multiple platforms, both Linux Apache and Windows IIS. Only recently have some versions of ASP been able to run on other platforms. So if you are looking for maximum platform compatibility, it is best to opt for PHP.



Developer Community

Unlike ASP, PHP has a fairly large developer community that is active in reporting bugs and creating additional PHP libraries. (See PEAR.)

Additionally, PHP developers have contributed to a variety of open source projects. In our article What Is Open Source?, we talk about some open source projects that have been built using PHP.



Speed

PHP is also faster than ASP. So if you have an application that performs multiple queries or is frequently accessed, it would be best to use a language that was more efficient.



Security

IIS Server (ASP) is notorious for its security holes.
2016-05-17 19:54:12 UTC
You can host your webpage in your own PC with your current internet connection for free. 1. Set up a dynamic DNS service, like DynIp. I use NoIp, which is free. Almost all routers support one or more providers. 2. Install IIS, unless you're unlucky to own XP Home 3. Download and install Web PIatform Installer from Microsoft, which includes the .NET Framework, SQL Server Express 2008, Visual Web Developer 2008. My cheap $250 home PC server has only has a 256Kbps upload speed. I wrote a "porfolio" web application in C#, ASP.NET. IMHO, if you plan to become a web guru, Linux sysadmin, or at your job there are Unix servers, choose LAMP (Linux, Apache, Mysql, Php), otherwise choose M$.
Clug
2012-03-23 22:28:57 UTC
An in-depth view can be seen here: http://www.pointafter.com/Archives/nl0203.htm

PHP has it's own language/syntax, whilst ASP uses VisualBasic and JavaScript.

ASP is developed by Microsoft, and therefore can only be run on IIS servers.

I personally prefer PHP.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...