php and asp lining in harmony

He has: 688 posts

Joined: Feb 2001

The vast majority of my code is html but all of my pages are php extentions, whether I have any php code in the page or not. No special coding is necessary for html if placed outside of the <? ?> tags and you can even use html inside the tags using something like the print function (and slashes in front of all quotation marks). Basically they can live in harmony.

But my question is about asp. Can asp co-exist with php? Can asp code be used within a php document or can php code be used within an asp document? Just curious. Thanks.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

I would think that on the language level, they would be fine... For example:

<?php
ini_set
("asp_tags", false);
echo
"php code
?>

<%
Response.Write "ASP code"
%>
<?php
echo "back to php";
?>
'I think the problem comes in on the server level. IIS, as far as I know, won't let you redirect the output from one interpreter to the input of another. Apache will, but I don't know of any ASP mods for it.

As for file extension. It doesn't matter. As long as your web server knows to pass the file through one interpreter then redirect the output to the next interpreter.

Mark Hensler
If there is no answer on Google, then there is no question.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.