http header

Post Reply
User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

http header

Post by Thunderstone »



Is there a way to change the HTTP header from
within webscript?

Modeling PubMed (http://www.ncbi.nlm.nih.gov/PubMed/)
I want to allow the user to push a submit button to
save select hits as a text file.




User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

http header

Post by Thunderstone »




Yes; I assume in this case you want to set the Content-Type to
text/plain. Then use a .txt extension in the URL to invoke Vortex; this
will set the Content-Type to text/plain. Ie. instead of the action URL:

/cgi-bin/texis/webinator/search/

use:

/cgi-bin/texis/webinator/search/yourfunc.txt

where "yourfunc" is the name of your text-generating function.

If you want to "manually" set any header, use the extension .bin. See
http://www.thunderstone.com/vortexman/node16.html for details.

-Kai


Kai Getrost | Thunderstone Software - EPI, Inc.
kai@thunderstone.com | info@thunderstone.com




User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

http header

Post by Thunderstone »



I have been at this for hours and I can't do it.
I want to right justify document numbers in HTML
output by left padding with &nbsp.

When I try this
<strfmt "%4i" $x>
<sandr "\space" "&nbsp" $ret>
<fmt "%s" $ret>:
only the first space is replaced with &nbsp
If I use "n" as the expression, then
all the spaces are replaced. I have tried a million
variants. Can anyone help?

--------------------------------------------------------------
Larry Rudner rudner@cua.edu
ERIC Clearinghouse on 800 464-3742 (800 Go4-ERIC)
Assessment and Evaluation 202 319-5120
Catholic University of America FAX: 202 319-6692
Washington, DC 20064 http://ericae2.educ.cua.edu


User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

http header

Post by Thunderstone »




Vortex is doing it correctly, but Netscape is lying to you
when you view source because it is confused by the lack of ; on
the end of &nbsp ( &nbsp; ). If you were to "save as html" and view
the file you would see the correct output.

Using the correct HTML coding for non breaking space will make it work.
Here's your code with a couple other minor changes:

<strfmt "%4i" $x>
<sandr " " "&nbsp;" $ret>
<send $ret>:

As you may know, space padding only works correctly with a fixed width
font. You might want to use a <table> instead. Then you can specify
alignment styles.


Post Reply