Now open up Notepad and simply paste the following markup into the page:
<%@ Page Language="C#" %> Login Page BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#333333" TextLayout="TextOnTop"> Font-Names="Verdana" Font-Size="0.8em" ForeColor="#990000" />
Save this file into the Qdig application folder as login.aspx. This has now enabled your Web application written in PHP to have ASP.NET based forms authentication. However, browsing to the site doesn't throw up the login page. This is because we still have one more configuration step to do.
Again, in IIS Manager, go to the Authorization Rules icon for Qdig. Edit the default rule that allows 'Everyone' access to allow only certain specific users (from the list that you added in the .NET Users earlier). Click on apply and now try browsing the site. You will be suddenly faced with a login page.
The application will now prompt you for credentials that will be matched with the users stored in the ASP.NET Membership data source and compared using the provider.
As you can see, with a few configuration changes, you have just added a complete forms authentication capability to an existing PHP application without changing even a single line of PHP code. You can extend this further by adding features such as URL Rewriting or Caching-again using simply configuration rather than code to get it working. This lets you do things in PHP that is impossible or difficult to do in the LAMP or XAMP stack very easily on IIS7. So in case you wish to host PHP applications, IIS7 is not just another platform that you can host it on, but one that offers much more features as well.
Get most out of your technology infrastructure investments with Dell
About CIOL | Media Kit | Site Map | Contact Us | Help | Write to us | Jobs@CyberMedia | Privacy Policy
Copyright © CyberMedia India Online Ltd. All rights reserved. Usage of content from web site is subject to Terms and Conditions.