Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Can I include a PHP file in an ASP page?

Options
  • 29-07-2006 4:33pm
    #1
    Registered Users 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 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