Hello - I am new to using PHP. I have coded in ASP for years.
I have a simple question.
I have an ASP page that displays data from an Access database. Works perfect. This ASP page has a few "include file" tags like this:
<!-- #include file="inc-page2.asp" -->
So the main ASP page is called index.asp. This page has two include file tags, which are:
<!-- #include file="inc-page2.asp" -->
<!-- #include file="inc-page3.asp" -->
The inc-page2.asp page has the code that extracts the info from the Access database.
So if I create PHP code to extract information from the MySQL database that I have, can that PHP page be substituted for the inc-page2.asp page, so the tag would be: <!-- #include file="inc-page2.php -->
I don't know if you can combine asp and php code.
I have tried combining the two types of code but all that shows on my index.asp is the actual PHP code where the data from the MySQL database should be. So I wasn't sure if it is possible.
Any info on this matter would be appreciated.
Combining PHP and ASP - can it be done?
Moderator: General Moderators
Re: Combining PHP and ASP - can it be done?
I wouldn't expect it could be done directly as an include. However, you could always create a simple API on the PHP/MySQL end that your ASP site consumes. Though, what is it you're trying to do? Can ASP not connect to the MySQL database directly?
Re: Combining PHP and ASP - can it be done?
Nevermind. Sorry for the post - I found out that you can't use include file tags on a php page. Thank you anyway
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Combining PHP and ASP - can it be done?
That does not mean you cannot include the output of these files in a PHP file. If you really don't want to recode them, you could run them on the command line and capture the out but from a PHP page.gcapp wrote:Nevermind. Sorry for the post - I found out that you can't use include file tags on a php page. Thank you anyway
(#10850)