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..

http://mydomain.com/PushNotifications.php?Token=row["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..

Thanks,
Jem
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.
[see http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5c5ae5e0-f4f9-44b0-a743-f4c3a5ff68ec.mspx?mfr=true]

Step Two:
Add the following to web.config

<buildProviders>

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

</

<httpHandlers>

<

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

</

httpHandlers>

or other way you can try it with the JAVA SCRIPT

<html xmlns="http://www.w3.org/1999/xhtml" >
< head runat="server">
<title>Untitled Page</title>
<script language="javascript">
function redirect(){
document.location.href="summary.txt";
}
</script>
< /head>
< body>
<form id="form1" runat="server" >
<div>
<a href="http://forums.asp.net/t/1211052.aspx#" onclick="redirect()">Click me</a>
</div>
</form>
< /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?