You are here: Re: How to load a CSV/TXT file in a textarea? « HTML « IT news, forums, messages
Re: How to load a CSV/TXT file in a textarea?

Posted by Martin P�pping on 03/25/06 16:48

Martin Pöpping schrieb:
> But now I want the content of my file in the textarea and I am asking
> myself, if this is possible only via HTML and without coding a file
> upload, for example with PHP

If somebody is interested, here is a solution with PHP:

<h1>Upload</h1>

<form
action="<?php echo $PHP_SELF ?>"
method="post"
enctype="multipart/form-data">
<input type="file" name="probe" />
<input type="submit" value="Go!" />
</form>
<hr />
<?php
if (isset($_FILES['probe']) and ! $_FILES['probe']['error']) {

move_uploaded_file($_FILES['probe']['tmp_name'], "./tmp/newfile.txt");

printf("Sie ist %u Bytes groß und vom Typ %s.<br />\n",
$_FILES['probe']['size'], $_FILES['probe']['type']);

?>
<textarea cols="50" rows="50"><?include('./tmp/newfile.txt')?></textarea>
<? }
?>




But my question still exists:

Is it possible to show the content of a txt-file in a textarea only with
using HTML?


Bye,
Martin

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация