Lately i learnt ASP.NET a little which is really great and i don't understand what are the adventages of PHP over ASP.NET. ASP.NET has easy built in tools like Membership which saves you a lot of time. it has a separate file for the server side code which makes the programming easier. it allows you to send back information to the server and it updates the page automatically, for example having a button which changes a photo in the current page while clicking it without forwarding to a new page. and the MASTERPAGE option is so good, with PHP i always have to copy paste every time i create a new page. those things are impossible with php isn't it? The disadvantage of ASP.NET is not being able to have 2 forms in the same page. and obviously the WINDOWS platform. i am sure there are more reasons using PHP and i would like to know them. thanks.
I wouldn't say one is superior to the other. There is some notable differences though that may make one language better for a situation than another. When it comes down to it, PHP is generally easier to learn and easier to use for smaller and medium size applications. It's open source, it's got a great community and a good official manual. Due to the fact that PHP doesn't have a lot of complex features, it's become popular for getting things done. It's also (like you said) readily available for many different platforms and web servers. There's also much more "free," ready-made scripts out there than there is for other languages and generally third party PHP scripts have more liberal licenses (i.e. not commercial). However there are some down sides to PHP. While it is pretty easy to use (without sacrificing too much), it's also somewhat slower sometimes and it doesn't come with a bunch of really complex features that are more necessary for larger and ambitious projects. When comparing to ASP .NET, PHP will need some additional "helper" features from PECL, PEAR, or PHP scripts to really compete. For example, caching isn't something that's really been pushed with PHP. Nor does it have a fancy framework with the MVC methodology being pushed as a standard. The usual database (MySQL) is just like PHP as well, it isn't too advanced. There's lots more you can do with Oracle or SQL Server than you can with MySQL. So to sum it all up, PHP is there for getting things done without all the extra complexities while ASP .NET or J2EE is there for industry and commercial players.
I agree with SeLfkiLL. In short, ASP.NET is more enterprise level, whereas PHP is medium size and smaller projects.
just to add, it boils down to what fits your requirement. if your requirement is simple content management system, I think php would be more than enough for the requirement. It doesn't have that extra baggage of irrelevant tools that comes with asp.net. However, these tools matter for large and/or corporate websites.
Many people say PHP is not enterprise level and no big businesses use them but this is not true. One of the biggest sites I can think of is I believe Yahoo has some PHP in it. It's more about using the language suitable for the job then which is better, worse or anything of that nature.