473,394 Members | 1,641 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,394 software developers and data experts.

Cgi: Print Text files with wordwrap!

Okay, I'm writing a cgi program, and I can send files and stuff, but how do
I send text files with word wrap enabled? If a line of text is wider than
the browser, and unsightly scrollbar appears on the bottom. How would I
make it so that the text automatically wraps in the browser without putting
a whole bunch of linebreaks in the text file?

--Walter Huf--
hu****@cobalty.com
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 18 '05 #1
3 2151
Walter Huf pushed the bounds of literature with:
Okay, I'm writing a cgi program, and I can send files and stuff, but
how do I send text files with word wrap enabled? If a line of text is
wider than the browser, and unsightly scrollbar appears on the bottom.
How would I make it so that the text automatically wraps in the
browser without putting a whole bunch of linebreaks in the text file?

--Walter Huf--
hu****@cobalty.com
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----


If you send plain text, it will be presented exactly how you send it, line
breaks and all.

If you want it to wrap to the browser window, you have to make it look
like HTML. The bare minimum you can get away with is <p> tags where you
want new paragraphs - plus a head and a tail.

--
Dale Strickland-Clark
Riverhall Systems Ltd, www.riverhall.co.uk
Jul 18 '05 #2
"Dale Strickland-Clak" <da**@riverhall.NOSPAM.co.uk> wrote in
news:Xn*********************************@192.168.8 .150:

If you send plain text, it will be presented exactly how you send it,
line breaks and all.

If you want it to wrap to the browser window, you have to make it look
like HTML. The bare minimum you can get away with is <p> tags where
you want new paragraphs - plus a head and a tail.


Awesome, thanks!
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 18 '05 #3
>>>>> "Dale Strickland-Clak" <da**@riverhall.NOSPAM.co.uk> (DS) wrote:

DS> If you send plain text, it will be presented exactly how you send it, line
DS> breaks and all.

DS> If you want it to wrap to the browser window, you have to make it look
DS> like HTML. The bare minimum you can get away with is <p> tags where you
DS> want new paragraphs - plus a head and a tail.

And you should replace < > and & by &lt; &gt; and &amp;
--
Piet van Oostrum <pi**@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.***********@hccnet.nl
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: dermoon | last post by:
Made this simple cgi-upload script that uses fieldstorage from a web-form. ASCII-based files works fine, but if i try to upload binary-files (word-documents, images) the files seems to be truncated...
5
by: Bernard | last post by:
Hi, I have a problem with a CGI script (Perl) on a Win2000 server. The script is for sending E-cards and was written by Jason Maloney:...
3
by: Tommo | last post by:
Hello All, I am a still learning so be easy on me. I am trying to get some code to work that is using JS and Perl/CGI, I am using AS Perl and an Apache Server on XP as the webserver. Can anyone...
4
by: gmazujian | last post by:
I have a problem. I would like to call a cgi program from javascript. I have scanned the web. I have a cgi program. It works fine if I call it by the url. However, when I call it from the...
4
by: marfi95 | last post by:
Hi all, I'm trying to do what I consider to be a fairly simple task, yet I'm having a heck of a time getting it to work. I'm trying to upload a file (without user intervention and a browser)...
3
by: cuties | last post by:
Hi all.... i'm very new to this programming language. i'm required to fulfill this task in the company i'm doing my practical. i hope i can get guide for my problem... Here is the script i...
2
by: prakharv | last post by:
Hi All, Below is the code which I am using to upload a jpeg file to the server. But the problem I am facing is that it is not copying the entire contents of the image file to the webserver and it...
4
by: arorap | last post by:
I've mod_php installed with Apache 2.2. In one of my folders, I'm using the cgihandler as the PythonHandler as my target host runs python only as CGI. Here cgi.FieldStorage() doesn't seem to work....
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.