PDA

View Full Version : Loading txt file


Elmore
05-08-2003, 05:39 PM
Hi!

Sorry to bother with this simple question...

I tried searching for answer but didn't find any so here it goes:

I'd like to know what kind of php script (or line) i'd need to use if i want to load txt files into a web page.

The reason for this would be that i'd like to "boost" my web designs with a little php and make them easier to update.

Is there a simple line i could include into a for example a html table?(that would then fill the table)

Thanks in advance!

Saj
05-08-2003, 05:52 PM
Like this:

Pretty much anywhere in your help, just add this:

<?php
include("filename.txt");
?>

Thats about it.

Elmore
05-09-2003, 10:33 AM
Hi!

Thanks for your answer.

I however couldn't get it to work :( but i found a line that did work
<? readfile("text.txt"); ?>

I would be interested to learn a little bit more about this "trick"

How could i make a layout that wouldn't "blow" to pieces when loading large txt-tiles. So that it would only expand vertically (the table)

Also are this type of design as safe as normal html.

I mean that are the .txt files anymore vulnerable than html files? (i know this sounds stoopid... but still would like an comment about this :))

Are there any (easy to understand) sites about these things?

Lot's of questions.. hopefully get some answers :)

firepages
05-10-2003, 02:00 AM
you should be able to control via HTML or CSS

<table width="250" height="100%">
<tr><td>
<? readfile("text.txt"); ?>
</td></tr>
</table>

+ what errors are you getting when you try include(); ? its a pretty basic && important function to have, and you would do well to try and get it working.