P{HP and ASP on the same page

This is a discussion on P{HP and ASP on the same page within the PHP Language forums, part of the PHP Programming Forums category; PHP / ASP interoperability question... I'm running IIS5 and PHP5 on a Windows 2003 server. Is it possible to use ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-19-2004
Jim
 
Posts: n/a
Default P{HP and ASP on the same page

PHP / ASP interoperability question...

I'm running IIS5 and PHP5 on a Windows 2003 server.

Is it possible to use both PHP and ASP on the same page?

If so, how, as the server just interprets the page depending on what
extension type it is (PHP, ASP for HTM)?



Jim


(I'm not opening a debate on the pro's and con's of doing this or PHP
v ASP, just after some answers!).

Reply With Quote
  #2 (permalink)  
Old 08-20-2004
Aidan
 
Posts: n/a
Default Re: P{HP and ASP on the same page

I highly doubt that is possible... the PHP and ASP code wouldn't be able to
share global variables, and so it would probably be pointless even if you
could do this...

"Jim" <nospam@raynet-uk.net> wrote in message
news:i97ai0lgdoml7aqfhlkikol738m49gn1n5@4ax.com...
> PHP / ASP interoperability question...
>
> I'm running IIS5 and PHP5 on a Windows 2003 server.
>
> Is it possible to use both PHP and ASP on the same page?
>
> If so, how, as the server just interprets the page depending on what
> extension type it is (PHP, ASP for HTM)?
>
>
>
> Jim
>
>
> (I'm not opening a debate on the pro's and con's of doing this or PHP
> v ASP, just after some answers!).
>



Reply With Quote
  #3 (permalink)  
Old 08-20-2004
Jochen Daum
 
Posts: n/a
Default Re: P{HP and ASP on the same page

Hi,

On Thu, 19 Aug 2004 22:40:15 +0100, Jim <nospam@raynet-uk.net> wrote:

>PHP / ASP interoperability question...
>
>I'm running IIS5 and PHP5 on a Windows 2003 server.
>
>Is it possible to use both PHP and ASP on the same page?
>
>If so, how, as the server just interprets the page depending on what
>extension type it is (PHP, ASP for HTM)?


I'm not running on IIS, so I can't quite try it, but maybe you could
link two ISAPI filters to a new filetype, like .psp or .ahp

Then you have to think of the order you want. Do you want ASP to
rewrite PHP code before execution or vice versa?
Do you want ASP to work on the results PHP produced or vice versa?

HTH,

Jochen
--
Jochen Daum - Cabletalk Group Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Reply With Quote
  #4 (permalink)  
Old 08-20-2004
Nikolai Chuvakhin
 
Posts: n/a
Default Re: P{HP and ASP on the same page

Jim <nospam@raynet-uk.net> wrote in message
news:<i97ai0lgdoml7aqfhlkikol738m49gn1n5@4ax.com>. ..
>
> I'm running IIS5 and PHP5 on a Windows 2003 server.
> Is it possible to use both PHP and ASP on the same page?


No. When you install PHP on IIS (assuming you are using the ISAPI
module), you add an application mapping that maps *.php files to
php4isapi.dll / php5isapi.dll, so they are parsed ONLY by that
library and that library ONLY parses *.php files.

In order to be able to write PHP inside an ASP page, you have to
have a PHP extension for Windows Scripting Host. ActiveState
implemented this for Perl a while ago and for Python more recently,
so you can write ASP pages in those languages, but, alas, no PHP
so far...

Cheers,
NC
Reply With Quote
  #5 (permalink)  
Old 08-20-2004
Jim
 
Posts: n/a
Default Re: P{HP and ASP on the same page

nc@iname.com (Nikolai Chuvakhin) wrote in message news:<32d7a63c.0408191826.74aace00@posting.google. com>...
> No. When you install PHP on IIS (assuming you are using the ISAPI
> module), you add an application mapping that maps *.php files to
> php4isapi.dll / php5isapi.dll, so they are parsed ONLY by that
> library and that library ONLY parses *.php files.
>
> In order to be able to write PHP inside an ASP page, you have to
> have a PHP extension for Windows Scripting Host. ActiveState
> implemented this for Perl a while ago and for Python more recently,
> so you can write ASP pages in those languages, but, alas, no PHP
> so far...
>
> Cheers,
> NC


Suspected this was the case!


Many thanks.

Jim
Reply With Quote
  #6 (permalink)  
Old 08-20-2004
Andy Hassall
 
Posts: n/a
Default Re: P{HP and ASP on the same page

On 19 Aug 2004 19:26:15 -0700, nc@iname.com (Nikolai Chuvakhin) wrote:

>> I'm running IIS5 and PHP5 on a Windows 2003 server.
>> Is it possible to use both PHP and ASP on the same page?

>
>No. When you install PHP on IIS (assuming you are using the ISAPI
>module), you add an application mapping that maps *.php files to
>php4isapi.dll / php5isapi.dll, so they are parsed ONLY by that
>library and that library ONLY parses *.php files.


I suppose if you were insane and had time on your hands you could write an
ISAPI application that itself loads the ASP and PHP ISAPI DLLs, and passes the
code first through one then the other.

Although working out what the follow does, or is even supposed to do, might
cause a few headaches:

<%
Dim i
For i = 0 to 20
%>
<?php
for ($i=0; $i<20; $i++)
print "$i<br>";
?>
<%
Response.Write(i & "<br>")
Next
%>

--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Reply With Quote
  #7 (permalink)  
Old 08-21-2004
CJ Llewellyn
 
Posts: n/a
Default Re: P{HP and ASP on the same page

"Jim" <nospam@raynet-uk.net> wrote in message
news:i97ai0lgdoml7aqfhlkikol738m49gn1n5@4ax.com...
> PHP / ASP interoperability question...
>
> I'm running IIS5 and PHP5 on a Windows 2003 server.
>
> Is it possible to use both PHP and ASP on the same page?
>
> If so, how, as the server just interprets the page depending on what
> extension type it is (PHP, ASP for HTM)?


You could call the php.exe binary from a shell object in ASP. You could use
com components in php. You could fetch the output from a script using HTTP.
As for including code for both in one scrip, not currently possible.


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:13 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0