ASP.NET - Execute PHP page url from aspx page - Asked By Jem Savery on 19-Nov-11 03:17 AM

Hi Friends, 

I need to execute a PHP page from my .aspx page? How can I do this?

The PHP page used to do some sort of work which sends messages to iPhone application.

So according to the data received from SQL Server, I need to execute that PHP page url for each record, it is something like this..["Token"].ToString()

It should not redirect to that page.

How can I do this? I am planning to create an aspx page and set it to in window scheduler to execute it everyday..

Suchit shah replied to Jem Savery on 19-Nov-11 04:19 AM
Try below steps :
Step One:
If you are managing your own servers install Wildcard Application Mappings in IIS or ask your hosting service to do it for you.

Step Two:
Add the following to web.config


<addextension=".php"type="System.Web.Compilation.PageBuildProvider" />




addverb="*"path="*.php"type="System.Web.UI.PageHandlerFactory"validate="True" />



or other way you can try it with the JAVA SCRIPT

<html xmlns="" >
< head runat="server">
<title>Untitled Page</title>
<script language="javascript">
function redirect(){
< /head>
< body>
<form id="form1" runat="server" >
<a href="" onclick="redirect()">Click me</a>
< /body>
< /html>

Using javascript you can redirect it to multiple pages, just add a argument and you will be happy with it and redirect to not one but many pages.

Jem Savery replied to Suchit shah on 19-Nov-11 09:05 AM
hi Suchit, 

thanks for replying, but in second case, you provided the code to redirect to the PHP page, I do not need to redirect, I just want to execute the page, it will have some event on load, which will do further action. I need to call this page for each record from database..

will the first option in second case will perform this?