hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : MIME type for asp (active server page)?
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

MIME type for asp (active server page)?

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-22-2005, 10:42 PM
d3nnis d3nnis is offline
Junior Guru
 
Join Date: Feb 2003
Location: Singapore
Posts: 240

MIME type for asp (active server page)?


Anyone knows?

Reply With Quote


Sponsored Links
  #2  
Old 09-23-2005, 12:04 AM
d3nnis d3nnis is offline
Junior Guru
 
Join Date: Feb 2003
Location: Singapore
Posts: 240
is this even possible?

test.php
Code:
<?
include "test.asp";
?>
test.asp
Code:
<%
response.write "hi!"
%>

Reply With Quote
  #3  
Old 09-23-2005, 07:01 AM
TechSolution TechSolution is offline
Web Hosting Evangelist
 
Join Date: Mar 2004
Posts: 502
PHP can't include ASP code and ASP can't do so for PHP code.

I say code because both interpreters will read the file as if it were just plain HTML and output it.

To set the MIME type, you need to do (in ASP)
Code:
Response.ContentType="text/html"

__________________
e-Tech-Solution.com: Shared Windows 2003 Hosting and Cross-platform Web Development

Reply With Quote
Sponsored Links
  #4  
Old 09-23-2005, 12:56 PM
d3nnis d3nnis is offline
Junior Guru
 
Join Date: Feb 2003
Location: Singapore
Posts: 240
let say i am using a windows server with IIS as web server (can read asp), and i have php installed... still not possible?

Reply With Quote
  #5  
Old 09-23-2005, 05:25 PM
TechSolution TechSolution is offline
Web Hosting Evangelist
 
Join Date: Mar 2004
Posts: 502
For PHP, you need to do something like:

PHP Code:
header('Content-Type: text/html'); 
You need to place this at the top of your page before you output anything before your PHP delimiter or in your script. If you need to do this half-way through your script, implement output buffering (just call ob_start() on the first line of your script). Just ensure that you don't output content between the start of the file and the PHP delimiter.

__________________
e-Tech-Solution.com: Shared Windows 2003 Hosting and Cross-platform Web Development

Reply With Quote
  #6  
Old 09-24-2005, 12:09 AM
d3nnis d3nnis is offline
Junior Guru
 
Join Date: Feb 2003
Location: Singapore
Posts: 240
Quote:
Originally posted by TechSolution
For PHP, you need to do something like:

PHP Code:
header('Content-Type: text/html'); 
You need to place this at the top of your page before you output anything before your PHP delimiter or in your script. If you need to do this half-way through your script, implement output buffering (just call ob_start() on the first line of your script). Just ensure that you don't output content between the start of the file and the PHP delimiter.
so its still possible to include a asp page within a php page?

Reply With Quote
  #7  
Old 09-24-2005, 01:41 AM
TechSolution TechSolution is offline
Web Hosting Evangelist
 
Join Date: Mar 2004
Posts: 502
No, it is not. PHP can't parse ASP code and ASP can't parse PHP code. Both can include files from each other, but they won't know what to do with the other code. (PHP might try to parse it if you have the ASP tags enabled)

__________________
e-Tech-Solution.com: Shared Windows 2003 Hosting and Cross-platform Web Development

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Apache Loses 9.9 Million Sites in Netcraft April 2013 Web Server Survey Web Hosting News 2013-04-03 14:42:33
Apache Leads Site Gains in January Netcraft Web Server Survey Web Hosting News 2012-01-03 19:02:26
Apache Sees Largest Gain in Netcraft December Web Server Survey Web Hosting News 2011-12-12 18:21:22
Apache Gains Most Sites in November Netcraft Web Server Survey Web Hosting News 2011-11-08 21:55:29
Certificate Authority Comodo Releases Free E-commerce Site Scanning Tool Web Hosting News 2011-06-23 17:27:14


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?