Content Type Question

Ask a Question related to Macromedia Dreamweaver, Design and Development.

  1. #1

    Default Content Type Question

    I have a question concerning the content type of an HTML file. I have a perl script that outputs the source of an HTML file. However, when I view this perl script in Mozilla, the script output appears as the HTML source code, not as the HTML page itself. When I add the line "content-type: text/html" to the top of the file, the script is displayed as HTML.

    Why does this single line of code matter? And what is the difference between this and the following line of HTML:

    "<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">"

    I don't understand the difference of the two and why the former is more important. Can anyone shed any light on this for me?

    Thanks,
    Jonah B.

    Jonah Bishop
    JGB Productions
    jonahb webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. .NET framework 1.1 SP1 MIME/Content-type problem
      Hi all, since i patched my server to the .NET framework 1.1 SP1 rss on my web site (http://www.Dotnet-Project.com) cannot diplay its content. By...
    2. Need help with Content-Disposition Content-Type
      I am trying to use the following script to allow users to download files with some of the file name stripped off. This script is for use on my...
    3. get content type out of a local file
      I'm having the folowing problem, My (logged in) users can get files from a directory by mail, I need to send a header with the mail like this:...
    4. Content Type = EXCEL in browser
      I'm trying to change content type of an ASPX page in the browser and send some data so the browser mimics an EXCEL spreadsheet (changed the content...
    5. PHP, Apache and content-type negociation
      Hi, there is an apparently relatively well known issue with Apache with PHP as a module and content-type negociation, whereby the very setup of...
  3. #2

    Default Re: Content Type Question

    I'm guessing that the extension of your page is probably either .cgi or .pl.
    Since these are raw text files anyway, if the browser doesn't know how to
    translate them, then you'll probably end up with text on the screen.
    Usually, the browser is set up to translate HTML if the extension is also
    ..htm(l). No problems there. But anything else, it doesn't necessarily
    know. However, if the browser sees the content type in there, then it can
    parse it properly.

    I ran into a similar problem a while back with .hcsp files, the proprietary
    extension for our content management system. Adding the content type to the
    page, as well as setting the mime type on the server to text/html, fixed the
    problem for me in all cases and all browsers.

    Best regards,
    Chris


    Chris In Madison Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139