Web Hosting Talk







View Full Version : Mixing ASP with PHP


happyhappy
11-10-2001, 09:28 PM
Anyone know if it's possible to mix ASP with PHP?

If it's possible, can you let me know how? :bawling:

Foo-Dawg
11-10-2001, 09:43 PM
The only way I can see that possible, is if a php script had an asp file included in it and php knew to parse it seperatly, or vice versa.

The Prohacker
11-10-2001, 10:05 PM
They are completely differnt languages, so I doubt that its possible...

AlexNguyen
11-10-2001, 10:26 PM
You could definitely use asp files along with php files in the same web application, if the webserver supports both technologies. You could not mix asp code in a php file or vice versa however.

Your session management would be a pain for sure, but if you implemented user sessions as part of a database scheme it could work.

I'm not sure the hassle is worth it.

happyhappy
11-10-2001, 10:27 PM
Well, the only way I know of mixing the two is with the use of <IFRAME> but I don't think that's supported on Netscape. Guess this is the main reason why I wanted to combine the two together onto one page.

Foo-Dawg, I'll try the include file and see if it works, but I'm fairly sure it won't coz the include file is basically the same as copying the contents of that file into the file that's calling the include file.

oh well...

happyhappy
11-10-2001, 10:31 PM
Originally posted by AlexNguyen
You could definitely use asp files along with php files in the same web application, if the webserver supports both technologies. You could not mix asp code in a php file or vice versa however.

Your session management would be a pain for sure, but if you implemented user sessions as part of a database scheme it could work.

I'm not sure the hassle is worth it.

That's how I got my stuff setup at the moment.

I know I should learn how to program in php. one day I'll get around to it :D

But right now I only know ASP and I'm downloading scripts written in PHP and somehow it'd be good if I can integrate the two :)

Asher S
11-11-2001, 01:01 AM
I personally think that php is FAR more flexible than asp.

delemtri
11-11-2001, 02:07 AM
Just use .htaccess and set PHP to be parsed in ASP files. :p

happyhappy
11-11-2001, 07:09 PM
That sounds real good, but how do I do that?

Have you got an example maybe? :stickout

delemtri
11-11-2001, 08:59 PM
Go to codingclick.com, there's a neat article on .htaccess there... I've never used it myself. But I think you can use it for this. :)

happyhappy
11-11-2001, 09:21 PM
According to that:
http://www.codingclick.com/article.php/aid/3

You can only use htaccess to
1/ create custom error pages,
2/ password protect folders
3/ protect bandwidth

It doesn't say anything about asp or php. But I think I'll find the site useful anyway - especially the pwd protect folder script :)

delemtri
11-11-2001, 09:29 PM
Bah, try this:

AddType text/php .asp

Or something like that... I'm sure someone else knows better than me.

getweb
11-12-2001, 03:06 AM
Whoa, whoa, whoa the .htaccess route and "AddType" will let you run an ASP page through the PHP interpreter but that won't really get you anywhere except Syntax-Error-Land.

I'm going to side with ProHacker and say it's pretty much impossible.

You could however make completely seperate pages that pass variables back and forth to each other. I've done this on more than one occasion to interface differing systems.

Like you say, learning PHP is the best route, and I think you'll find it's much less of a headache than solving this problem. I was born and raised on ASP, and was able to write database-driven PHP pages in less than a week of part-time research. They have many similarities, and every difference that I've found I like PHP's way better anyways. I mean, I know you're sold on PHP, I'm just saying you'll probably surprise yourself how quickly you can pick up PHP if you already do ASP.

Study the scripts you downloaded, mess around, piece of cake. You'll be PHPhappyhappy in no time. :rolleyes: :D

KDAWebServices
11-12-2001, 02:58 PM
It is perfectly possible to mix the two you can have PHP running in ASP - why? Because ASP is NOT a language it is an application framework that provides the hooks into the web server software, what you people refer too as ASP is actually VB Script. The ASP framework can use pretty much any language to code with such as Perl, JScript, PHP etc.

So what you really wanted to ask was can you mix VB Script and PHP in the same page, and in that case the answer is no as far as I am aware as IIS doesn't support filter chaining like Apache 2.0 will do.

DougBTX
11-12-2001, 03:48 PM
Make sure you dont cross you initals...:

"Active Server Page(s) (Microsoft web scripting language and file extension)"

or

"Application Service Provider (Internet/web)"

Both from....: http://www.acronymfinder.com/af-query.asp?p=dict&String=exact&Acronym=ASP if you dont like it...

hth,
Douglas

happyhappy
11-20-2001, 03:49 AM
Originally posted by KDAWebServices
It is perfectly possible to mix the two you can have PHP running in ASP - why? Because ASP is NOT a language it is an application framework that provides the hooks into the web server software, what you people refer too as ASP is actually VB Script. The ASP framework can use pretty much any language to code with such as Perl, JScript, PHP etc.

So what you really wanted to ask was can you mix VB Script and PHP in the same page, and in that case the answer is no as far as I am aware as IIS doesn't support filter chaining like Apache 2.0 will do.

OK, never mind then. I'll have to find some way around it.

Thanks for your help

Viapointe
11-20-2001, 08:44 PM
Actually you can program both in Flash. I know a good flash developer that was dealing with that same problem, he said it was no big deal.