Solved

Batch file to create a web page thru cgi

Posted on 1998-04-20
2
446 Views
Last Modified: 2013-12-25
Setup:  web server residing on NT file server.

Question:
I'm trying to generate a web page using a simple batch file.  However, the problem I'm running into is in echoing a blank line to the webserver after
Content-type: text/html

In Perl, this would be
print "Content-type: text/html\n\n";

In DOS, I'm using
@echo off
echo Content-type: text/html


Now, how do I echo a blank line?  Type echo on a line by itself just echos echo is off.

It seems to me that this question should be really easy, but if it isn't, let me know.

Thanks!
0
Comment
Question by:bigelos
2 Comments
 
LVL 8

Accepted Solution

by:
MaDdUCK earned 50 total points
ID: 1827655
Use the command 'echo.' (echo followed by a period). This will output \n to stdout.

Ths your code is:
@echo off
echo Content-type: text/html
echo.
echo.
echo <html>
...

hope this helps...
\\madduck
0
 
LVL 3

Author Comment

by:bigelos
ID: 1827656
MaDdUCK,

Thanks.  I knew it was something like that, but I had the space between echo and the period, and that wasn't working very good.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now