Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Mar 2003
    Posts
    601

    Default problem with cgi scripts displaying html?

    On one of my servers it appears that there is a problem with the cgi scripts.

    The code in the scripts themselves seems to be working fine, but if I try to print out html, the screen doesn't parse it. And it seems to be doing it to all of the scripts that are on the server, of which, most of them were working previously.

    Here is an example. If I do a script with:

    PHP Code:
    #!/usr/bin/perl

    print "<a href = test.html>testing</a>"
    the output is

    PHP Code:
    <a href test.html>testing</a
    Anyone else experience this before?

  2. #2
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    Try putting this line ahead of the printing:
    print("Content-Type: text/html\n\n");
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  3. #3
    Member
    Join Date
    Mar 2003
    Posts
    601

    Default

    Quote Originally Posted by PWSowner View Post
    Try putting this line ahead of the printing:
    print("Content-Type: text/html\n\n");
    That worked. I noticed a lot of the scripts had this instead:

    The line : print "Content-type: text/plain";

    Now this seems to work fine in Internet explorer, but not in Mozilla.

    print "Content-type: text/html";

    works in both...

    Thanks,
    Damion

  4. #4
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    That's because IE is designed to make assumptions to attempt to correct some errors. Telling the browser it's plain text being sent will make most browsers simple show the code as plain text. All browsers except IE need to be told it's html.

    Never use IE when designing sites because you can have many errors without even knowing it, and IE is dropping in % usage.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

Similar Threads & Tags
Similar threads

  1. index.html still not displaying
    By pbarts100 in forum New User Questions
    Replies: 6
    Last Post: 08-30-2011, 09:46 AM
  2. Problem with dark.cgi scripts !!!
    By p-root in forum Security
    Replies: 7
    Last Post: 11-19-2009, 07:01 AM
  3. Problem with dark.cgi scripts !!!
    By p-root in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 11-19-2009, 07:01 AM
  4. Nobody-Mail-Problem with PHP & CGI-Scripts
    By JapAniManga.ch in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 08-08-2002, 03:01 AM
  5. neomail displaying html email
    By bdraco in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-18-2002, 06:29 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube