473,651 Members | 3,004 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2163
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.n l>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.***********@h ccnet.nl
Jul 18 '05 #4

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

Similar topics

0
1618
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 - e.g. an image-file that contains 3398 bytes is uploaded with only 425 bytes. Am I doing something wrong here? Here is the code in full: <!-- The form--> <FORM METHOD="POST" ACTION="cgi-bin/upload.py"
5
3874
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: http://www.aestheticsurgerycenter.com/scripts/postcard/postcard1.shtml You can choose from some cards, add your own text and send it to a friend. This friend get a mail which tell him/her that he/she has a mail and have to click a link. So far everything works just fine. But when the recipient clicks...
3
2781
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 take a look at the code and tell me why I am getting Apache Server errors in the code below (Part A), when I modify the code as shown in part B the errors go but the JS does not run ?? Part A.
4
1770
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 javascript script it appears to do nothing. It doesn't generate any error. First, Here is my html with Javascript. <script type="text/javascript" language="JavaScript" src="/cgi-bin/cookie/script1.cgi"> </script>
4
3871
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) from a vb.net client (using webclient or httpwebrequest) to a webserver running a cgi script to store it on the webserver. I'm not familiar with perl/cgi very well and am really struggling with it. I kind of got it to partially work with...
3
3004
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 already wrote but i'm having problem to move forward. my problem is : 1. how do i assign each checkbox to have equal value with the value of the d_id?
2
5950
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 doesn't works on IE. Please, help me out as I am new to this and would be highly thankful if anyone has running code for uploading image files to the server using CGI either Perl or C. This code i took it from net only. #!/usr/bin/perl -w
4
4873
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. I can see the form data in sys.stdin but cgi.FieldStorage() returns an empty dictionary. Here's the code for the test script I am posting to - -- #!/usr/bin/python
21
34382
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 obvious of which is the sharing of files. For example, you upload images to a server to share them with other people over the Internet. Perl comes ready equipped for uploading files via the CGI.pm module, which has long been a core module and allows users...
0
8357
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8700
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8581
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5612
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4285
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1910
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.