seco Posted January 24, 2008 Share Posted January 24, 2008 Hi if my hosting supports asp.net and php can i mix php and asp.net code in one page ? thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/87549-can-i-mix-php-and-aspnet-in-one-page/ Share on other sites More sharing options...
PHP Monkeh Posted January 24, 2008 Share Posted January 24, 2008 My intial response would be no. As in, asp pages end in .asp, php in .php - how would you propose to mix it? Maybe someone else can explain a way, but a question I'd ask is why would you want to? Quote Link to comment https://forums.phpfreaks.com/topic/87549-can-i-mix-php-and-aspnet-in-one-page/#findComment-447787 Share on other sites More sharing options...
JSHINER Posted January 24, 2008 Share Posted January 24, 2008 I don't believe this is possible, and I agree, why would you want to? Keep ASP as far away as you can. Quote Link to comment https://forums.phpfreaks.com/topic/87549-can-i-mix-php-and-aspnet-in-one-page/#findComment-447875 Share on other sites More sharing options...
kts Posted January 24, 2008 Share Posted January 24, 2008 I'm sure there is a way, but it would cause your server to give you the drunken eyes on most executions. :-X Quote Link to comment https://forums.phpfreaks.com/topic/87549-can-i-mix-php-and-aspnet-in-one-page/#findComment-447880 Share on other sites More sharing options...
taith Posted January 24, 2008 Share Posted January 24, 2008 yes it is possible... in your httpd.conf or .htaccess add this "AddType application/x-httpd-php .asp" then... in any .asp pages... you should be able to use php :-) Quote Link to comment https://forums.phpfreaks.com/topic/87549-can-i-mix-php-and-aspnet-in-one-page/#findComment-447883 Share on other sites More sharing options...
nadeemshafi9 Posted January 24, 2008 Share Posted January 24, 2008 wow Quote Link to comment https://forums.phpfreaks.com/topic/87549-can-i-mix-php-and-aspnet-in-one-page/#findComment-447884 Share on other sites More sharing options...
revraz Posted January 24, 2008 Share Posted January 24, 2008 So you're saying that .php will parse .asp code? yes it is possible... in your httpd.conf or .htaccess add this "AddType application/x-httpd-php .asp" then... in any .asp pages... you should be able to use php :-) Quote Link to comment https://forums.phpfreaks.com/topic/87549-can-i-mix-php-and-aspnet-in-one-page/#findComment-447885 Share on other sites More sharing options...
The Little Guy Posted January 24, 2008 Share Posted January 24, 2008 You CAN NOT due to the fact that the extention is either PHP or ASP/ASPX. that extension triggers a file on the server, which then parses the info in that file. so... if you have a php extension, it will open the php parser. If you have a asp/aspx extension it will open the .net parser, and neither one know how to parse each others code... but their may be some sort of extension for php out there that can parse asp using the php parser. Quote Link to comment https://forums.phpfreaks.com/topic/87549-can-i-mix-php-and-aspnet-in-one-page/#findComment-447886 Share on other sites More sharing options...
nadeemshafi9 Posted January 24, 2008 Share Posted January 24, 2008 You CAN NOT due to the fact that the extention is either PHP or ASP/ASPX. that extension triggers a file on the server, which then parses the info in that file. so... if you have a php extension, it will open the php parser. If you have a asp/aspx extension it will open the .net parser, and neither one know how to parse each others code... but their may be some sort of extension for php out there that can parse asp using the php parser. thats what i was thinkming, and u can only get proper asp on windows and you can onlyu get proper php on unix, so you will have two dumbed down versions running on either windows or unix would be a shiddy chicken maybe it thoght it was ASPm because u used asp stule tags Quote Link to comment https://forums.phpfreaks.com/topic/87549-can-i-mix-php-and-aspnet-in-one-page/#findComment-447887 Share on other sites More sharing options...
The Little Guy Posted January 24, 2008 Share Posted January 24, 2008 The only way you can run php and asp is by having 2 separate files, and use a windows server, along with that you would have to have both php and asp parsers installed. Then you would have to make sure that your web server is connecting to both parsers so it knows where they are when it needs to use them to convert either php or asp to html. so... if all that works... then you could have files named like so: contact.php send_contact.asp Where contact.php creates a contact form using php and send_contact.asp sends the email to the email address. -- This will work (if codded correct without errors). Quote Link to comment https://forums.phpfreaks.com/topic/87549-can-i-mix-php-and-aspnet-in-one-page/#findComment-447897 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.