Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Can I include a PHP file in an ASP page?

  • 29-07-2006 04:33PM
    #1
    Registered Users, Registered Users 2 Posts: 145 ✭✭


    Hi,
    I've always used ASP - am thinking of trying some stuff in PHP...
    Would I be able to include these in an ASP file using the ASP Include option?

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 1,464 ✭✭✭evilhomer


    As far as i'm aware they would not be processed by the php preprocessor as the .asp extension would be compiled by the .net CLR.

    however it would be simple to test. Just write a simple hello world php tag, save it as a file and include the file inside your ASP page and see what happens.

    [PHP]
    <?php
    echo 'Hello, World!';
    ?>
    [/PHP]

    Maybe the php preprocessor will pick up the include and precompile the php for you, but I doubt that.


  • Closed Accounts Posts: 2,046 ✭✭✭democrates


    Interesting question. Afaik apache will parse based on the file extension, and you can configure any file extension to be parsed by any processor, eg .htm could be mapped to the php interpreter if you were that way inclined. Php can also use asp <%%> tags, but can apache mix and match vbscript and php in the one file, my gut feeling is no, I've a vague recollection of not getting php and perl to work in one script in the murky past, but maybe recent versions of apache allow it.

    Also I wonder about session variables and the globals array etc given php, perl and vbscript datatypes are stored and handled very differently. And if you have php using asp tags and in html you put <%=username%> how does apache know whether this is a php defined constant or an asp variable? Maybe if you configure for mixed interpreters short tags aren't allowed.

    And iis is another bag of marbles. Test and google, I plead ignorance!


Advertisement