I would like to change the text on my web site frequently, but I am getting tired of constantly changing and uploading the whole HTML source code.
Is there a way, how I could tell the HTML to read the text from a TXT file? So then I would just need to change and upload via FTP the TXT file.
I have a guess, I will need JS for this?
Page 1 of 1
HTML reading TXT file?
#1
Posted 05 May 2009 - 09:25 PM
Message from Patbox: I AM LOOKING FOR A GIRLFRIEND (PM if interested) :-)
#2
Posted 05 May 2009 - 10:17 PM
Quote
I could tell the HTML to read the text from a TXT file
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens
#3
Posted 06 May 2009 - 12:04 PM
Quote
I . You could use javascript, but personally, it would be much easier with something like PHP or ASP. I bet your provider allows for one of those. 
Yep, but my skills don't :-) But hey HTML can display *.jpg files, so in theory I would not feel shocked if it could display a *.txt file.
I recall, I read about a black-board script on your blog... is the code and image freely available for download?
Message from Patbox: I AM LOOKING FOR A GIRLFRIEND (PM if interested) :-)
#4
Posted 06 May 2009 - 12:18 PM
Everything is there, but that is done using Silverlight, which is yet another language. Feel free to nab the image if you want; I don't have the source code posted yet though. I am in the middle of migrating my stuff over to another server, and I had planned on adding source to a few of the projects there. Anyway, the text manipulation there is done with C#, so that is yet another language.
PHP is not too difficult to learn. The PHP code to read a file is pretty simple:
PhP is essentially just embedding php code into your HTML. Zend has some really nice tutorials.
PHP is not too difficult to learn. The PHP code to read a file is pretty simple:
$myFile = "testFile.txt"; $fh = fopen($myFile, 'r'); $theData = fgets($fh); fclose($fh); echo $theData;
PhP is essentially just embedding php code into your HTML. Zend has some really nice tutorials.
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens
#5
Posted 07 May 2009 - 08:26 PM
I agree with Groovicus, it would be a lot easier to use PHP to read a file and display the content.
that way you only have to mod the file and your done.
Most of the provider's i have dealt with have PHP. If you are hosting it yourself, PHP is not to hard to install on both *nux and Windows systems.
that way you only have to mod the file and your done.
Most of the provider's i have dealt with have PHP. If you are hosting it yourself, PHP is not to hard to install on both *nux and Windows systems.
If I am helping you and don't reply in 24 hours please send me a PM
There's no place like 127.0.0.1
There are 10 types of people in the world, those that can read binary, and those who can't.
There's no place like 127.0.0.1
There are 10 types of people in the world, those that can read binary, and those who can't.
Share this topic:
Page 1 of 1

Help



Back to top









