P{HP and ASP on the same page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim

    P{HP and ASP on the same page

    PHP / ASP interoperabilit y 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!).

  • Aidan

    #2
    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@rayne t-uk.net> wrote in message
    news:i97ai0lgdo ml7aqfhlkikol73 8m49gn1n5@4ax.c om...[color=blue]
    > PHP / ASP interoperabilit y 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!).
    >[/color]


    Comment

    • Jochen Daum

      #3
      Re: P{HP and ASP on the same page

      Hi,

      On Thu, 19 Aug 2004 22:40:15 +0100, Jim <nospam@rayne t-uk.net> wrote:
      [color=blue]
      >PHP / ASP interoperabilit y 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)?[/color]

      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.
      Download PHP DB Edit Toolkit for free. PHP DB Edit Toolkit is a set of PHP classes makes the generation of database edit interfaces easier and faster. The main class builds tabular and form views based on a data dictionary and takes over handling of insert/update/delete and user input.

      Comment

      • Nikolai Chuvakhin

        #4
        Re: P{HP and ASP on the same page

        Jim <nospam@rayne t-uk.net> wrote in message
        news:<i97ai0lgd oml7aqfhlkikol7 38m49gn1n5@4ax. com>...[color=blue]
        >
        > I'm running IIS5 and PHP5 on a Windows 2003 server.
        > Is it possible to use both PHP and ASP on the same page?[/color]

        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

        Comment

        • Jim

          #5
          Re: P{HP and ASP on the same page

          nc@iname.com (Nikolai Chuvakhin) wrote in message news:<32d7a63c. 0408191826.74aa ce00@posting.go ogle.com>...[color=blue]
          > 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[/color]

          Suspected this was the case!


          Many thanks.

          Jim

          Comment

          • Andy Hassall

            #6
            Re: P{HP and ASP on the same page

            On 19 Aug 2004 19:26:15 -0700, nc@iname.com (Nikolai Chuvakhin) wrote:
            [color=blue][color=green]
            >> I'm running IIS5 and PHP5 on a Windows 2003 server.
            >> Is it possible to use both PHP and ASP on the same page?[/color]
            >
            >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.dl l / php5isapi.dll, so they are parsed ONLY by that
            >library and that library ONLY parses *.php files.[/color]

            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.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

            Comment

            • CJ Llewellyn

              #7
              Re: P{HP and ASP on the same page

              "Jim" <nospam@rayne t-uk.net> wrote in message
              news:i97ai0lgdo ml7aqfhlkikol73 8m49gn1n5@4ax.c om...[color=blue]
              > PHP / ASP interoperabilit y 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)?[/color]

              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.


              Comment

              Working...