473,320 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

"Content-type" etc displaying in browser

Hello everyone,

I'm learning Perl again!

I am writing a CGI script that has two possible outcomes. So I have broken up the HTML output into four parts:

Beginning (header and the start of the HTML)

Option 1 OR
Option 2

Ending (remainder of the HTML)

This works fine as a program, the different options display according to the input. However, at the top of the second and third parts to display (ie. Option 1 and then the Ending or Option 2 and then the Ending), there is an annoying piece of text that shouldn't be there:

Content-Type: text/html; charset=ISO-8859-1
The code for the various HTML outputs is:

Expand|Select|Wrap|Line Numbers
  1.  
  2. if ($id == $transaction) {
  3.  
  4.     # we can print the results
  5.  
  6.     print header, <<"EOF";
  7.  
  8. [various HTML stuff]
  9.  
  10. EOF
  11.  
  12.  
For the Beginning, this works without any unseemly messages. For the Options and End the message appears. I have tried adding:

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3.  
To the non-Beginning outputs, but this has not surpressed the message.

Does anyone have an idea as to what to try next?

Thanks!
David
Sep 1 '07 #1
3 1336
numberwhun
3,509 Expert Mod 2GB
Hello! Welcome back to Perl again.

Would it be possible for you to post your whole code so we could evaluate it and see if we can find where the extra text might be coming from?

Regards,

Jeff
Sep 1 '07 #2
KevinADC
4,059 Expert 2GB
look in the script, you might have this twice and it's gtting printed twice:

print header

the header needs to only be printed once.
Sep 1 '07 #3
Thank you SO much KevinADC, that was exactly the problem!
Sep 1 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Sugapablo | last post by:
In the following file below, I want it to return itself as a Rich Text Format file that populates the variables with data from the database. I set up the mime types and the filename accordingly....
2
by: Todd Anderson | last post by:
I'm ussing this <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> to keep me html page from caching. But it's not working. Is there a javascript that will do this? Thanks in advance for your help.
10
by: Blue® | last post by:
I would like to call the content of content.htm (containing only HTML codes) into index.htm. This is usually done by renaming index.htm to index.shtml and use this tag: <!--#include...
10
by: Michael Strorm | last post by:
Hi! I've been having problems with a DTD. Having had the Sun XML validator reject a document, I put it through 'xmllint' for more information. 'Xmllint' noted a problem with the DTD itself;...
0
by: J.Edwards | last post by:
I'm getting this error when trying to use a control built in VS 2003 (1.1) in a new asp project in VS 2005. "Content controls can only be used in a content page" The control has always worked...
1
by: Henry Law | last post by:
(I posted this to comp.infosystems.www.browsers.misc but there seems to be very little traffic there. I can't see another suitable group; is it on topic here? If not, any suggestions as to...
0
by: Kevin Frey | last post by:
We have a data-centric application where all of the "layout" for each data centric page is to be codified (ie. it is expressed in C# code rather than being expressed declaratively). This...
1
by: dave8421 | last post by:
Hi, I'm trying to make sense of the definition for "Rendered Content" in current CR for CSS 2.1 Is rendered content what is displayed on the particular media or device? from the...
3
by: Alexander Smirnov | last post by:
I'm developing asp.net 2 web application and need to make a custom http handler which sometime must send response with "204 No Content" code. I set HttpResponse.Status="204 No Content"; But asp...
0
by: wizofaus | last post by:
If you use your browser to navigate to http://www.fsa.gov.uk/register/, it will redirect you to http://www.fsa.gov.uk/register/home.do;jessionid= etc. etc. etc. But if you use WebRequest to fetch...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.