#1 (permalink)  
Old 11-13-2006, 09:03 PM
Registered User
 
Join Date: Mar 2003
Posts: 574
noimad1
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-14-2006, 12:11 AM
PWSowner's Avatar
Registered User
 
Join Date: Nov 2001
Location: ON, Canada
Posts: 2,991
PWSowner is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-14-2006, 04:41 PM
Registered User
 
Join Date: Mar 2003
Posts: 574
noimad1
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-15-2006, 01:59 AM
PWSowner's Avatar
Registered User
 
Join Date: Nov 2001
Location: ON, Canada
Posts: 2,991
PWSowner is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 02:45 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc