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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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!). |
|
|||
|
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!). > |
|
|||
|
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/ |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
"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. |