Closed Thread Icon

Topic awaiting preservation: php content-type blah blah doesn't work (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12411" title="Pages that link to Topic awaiting preservation: php content-type blah blah doesn&amp;#039;t work (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: php content-type blah blah doesn&#039;t work <span class="small">(Page 1 of 1)</span>\

 
maninacan
Paranoid (IV) Inmate

From: Seattle, WA, USA
Insane since: Oct 2001

posted posted 09-07-2002 19:14

ok, so what I want to do is read a file and output the text of the file to the browser. So if it's an html page, it won't show what the html does, it will just show the text of the file. So the code I have so far is this:

<?php

header("Content-type: text/plain");
readfile("C:\Jason\Website\garfield\index.html");

?>

I was thinking if I just sent a header saying that it's plain text and not something else that it would just show the plain text, but for some reason it's not working, and it's displaying the html.

Maninacan Cell #471
behmer

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 09-07-2002 20:27

you can try that too:

code:
$fn = 'index.htm';
$fp = fopen($fn, 'r');
$mem = fread($fp, filesize($fn));
fclose($fp);
echo htmlentities($mem);



maninacan
Paranoid (IV) Inmate

From: Seattle, WA, USA
Insane since: Oct 2001

posted posted 09-08-2002 02:37

well it's not only for html files, so I don't think that'll work.

Maninacan Cell #471
behmer

« BackwardsOnwards »

Show Forum Drop Down Menu