10-31-2003
Presumably, you want more than just a listing of files (which can be produced without the intervention of any scripting language)?
If so, the script is called from a cgi bin and dynamically converts the data attributes (i.e. in this case a list of files) into valid HTML which is (usually) streamed to the browser.
The important line is the first output line which begins:
Content-type: text/html\n\n
The rest is just normal HTML encoding...
8 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Dear Experts,
I am new to UNIX and I have a script below and in this test case I am reading the names of the files in the present directory into a variable and then looping through each file name and displaying the name back to the screen. The problem I have is although there are 5 files in the... (4 Replies)
Discussion started by: markjohnlowe
4 Replies
2. Shell Programming and Scripting
i having problems figuring out how to 'read' in 3 different directory listings and then display them on the screen into 3 separate columns.
i thought i could use a 'for' loop to grab each directory and then assign a unique variable to each line 'read' in.
of course, as you experts all know,... (16 Replies)
Discussion started by: mjays
16 Replies
3. Web Development
Because of permission issues, I need to link to images in my web page which are stored in /tmp which of course is located in the root directory but my actual html page is much further down in another directory. I thought the the following code should work, but the image comes up as a broken link:... (2 Replies)
Discussion started by: Solerous
2 Replies
4. Shell Programming and Scripting
I have a bash script to output the contents of a text file to html. Everything outputs ok, except this:
######################################################################
# #
# PRIVATE/PROPRIETARY #
# #
# ANY UNAUTHORIZED ACCESS TO, OR MISUSE OF ABC COMPANY #
# SYSTEMS OR DATA MAY... (2 Replies)
Discussion started by: numele
2 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I want that the prompt that is being displayed (i.e $ sign) should display always the current directory I am working in instead of that $ sign
example:
as we use PS1=patric and the prompt changes from $ to patric OR
if we write the command PS1=`pwd` it will display the current... (5 Replies)
Discussion started by: premjotsingh
5 Replies
6. Shell Programming and Scripting
Hello,
I just saw that on my vps (centOS) my oscommerce with a seo script
has created millions of tmp files inside the /html/cache/ directory.
I would need to remove all those files (millions), I tried via shell but the vps
loads goes to very high and it hangs, is there some way to do a... (7 Replies)
Discussion started by: andymc1
7 Replies
7. Shell Programming and Scripting
I have downloaded source code for 97 files using:
wget -x -i link.txt then run a rename loop:
for file in *
do
mv $file $file.txt
done to keep the html tags but make the file a text that can be parsed.
In each of the 97 txt files the gene # is variable, but the gene is associated... (15 Replies)
Discussion started by: cmccabe
15 Replies
8. UNIX for Beginners Questions & Answers
Hi All.
I am facing a strange scenario
(c13:pq1:/pq1/buffer>) ll ../dataCS/*
ls: cannot access ../dataCS: No such file or directory
(c13:pq1:/pq1/buffer>) cd ../dataCS
(c13:pq1:/pq1/dataCS>) ll *
-rw-rw-r-- 1 pq1 pq10 Mar 1 13:43 test
(c13:pq1:/pq1/dataCS>) ll ../dataCS/*
-rw-rw-r--... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies
LEARN ABOUT PHP
mb_output_handler
MB_OUTPUT_HANDLER(3) 1 MB_OUTPUT_HANDLER(3)
mb_output_handler - Callback function converts character encoding in output buffer
SYNOPSIS
string mb_output_handler (string $contents, int $status)
DESCRIPTION
mb_output_handler(3) is ob_start(3) callback function. mb_output_handler(3) converts characters in the output buffer from internal charac-
ter encoding to HTTP output character encoding.
PARAMETERS
o $contents
- The contents of the output buffer.
o $status
- The status of the output buffer.
RETURN VALUES
The converted string.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 4.1.0 | |
| | |
| | This handler now adds the charset HTTP header |
| | when the following conditions are met: |
| | |
| | o Content-Type has not been set, |
| | using header(3). |
| | |
| | o The default MIME type begins with |
| | text/. |
| | |
| | o The mbstring.http_input setting |
| | is something other than |
| | pass. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
mb_output_handler(3) example
<?php
mb_http_output("UTF-8");
ob_start("mb_output_handler");
?>
NOTES
Note
If you want to output binary data, such as an image, using PHP 4.3.0 or later, a Content-Type: header must be set using header(3)
before any binary data is sent to the client (e.g. header("Content-Type: image/png")). If Content-Type: header is sent, output char-
acter encoding conversion will not be performed.
Note that if 'Content-Type: text/*' is sent, the content body is regarded as text; conversion will take place.
If you want to output binary data, such as an image, using PHP 4.2.x or earlier, you must set output encoding to "pass" using
mb_http_output(3).
SEE ALSO
ob_start(3).
PHP Documentation Group MB_OUTPUT_HANDLER(3)