Working on a project, one of the webpages will display a list of people (specifically, a list of people from a graduation class that haven't been located yet). Instead of manually updating these lists in tables which is a boneheaded Web 1.0 way of doing it, I'd like to take the submitted list of names, convert them to a simple .txt list, and then display that list on the webpage.
So far, the easist way to do this is to use an iframe element... only thing is, I cannot (or don't know how to) apply any text styling to the contents of the iframe. I've published a sample of what I've been able to accomplish here: http://dongarber.com/test//helpus-iframetest.html
The default font is courier, and the client probably ain't gonna be too keen on it. Is there a better way to do this, that's doesn't require ASP.NET or a database?
#list p {
font: arial;
font-size: 14px;
}
...
<p>Help us locate all of our classmates from the High School class of 1961. If you know where they live or their e-mail addresses contact the Reunion Committee.</p>
<p> </p>
<div id="list"><p><iframe src="missingmen.txt" width=200 height=400 frameborder=0 ></iframe></p></div>
</div>
If you just want to throw the contents of the file onto the screen you can try using PHP.
I find that if I try things that others say do not work, it's how I learn the most.
This worked for me. I used the yellow background-color that I set in the stylesheet.
In more recent browsers code like below may be enough.
You cannot style a text file, it must be HTML
Easy way:
missingmen.txt
tomissingmen.html
.missingmen.html
:<link href="txtstyle.css" rel="stylesheet" type="text/css" />
txtstyle.css
, and add to it a line like this:html, body {font-family:Helvetica, Arial, sans-serif}
That's the code I use:
Keep in mind that if the user can modify $path or $file (for example via $_GET or $_POST), he/she will be able to see all your source files (danger!)