Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

HTTP Headers

 
Ranch Hand
Posts: 837
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm developing an application (in Perl) that writes HTML code to an .htm file and later provides links to these HTML pages. Heres the question: when I write "Content-type: text/html \n\n" to the first line of the new HTML page and then try to display this page it shows this header as text in the page (in NS). Does anyone know how I can fix this from showing? The two newline characters are there because a HTTP header supposedly needs a line separating it from the HTML code below. Any help would be welcomed. Thanks.
Rob
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's been a while since I have done Perl/CGI work but you may want to ensure that only the last header has the TWO newline characters. If a header before Content-type ends with two new lines it would cause what you are seeing... the double new lines are used to say "hey I am done, no more headers here".
Hope this helps.
 
Rob Hunter
Ranch Hand
Posts: 837
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Chris. Yeah I've read about HTTP header "sensitivity" on a page but the problem I'm having is that it still prints it. Any other ideas behind why it is happening? It only happens on some of the pages too which would seem to suggest that spacing is the problem but it doesn't seem to be. Thanks again for the reply.
Rob
 
Bring me the box labeled "thinking cap" ... and then read this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic