displaying contents of notepad in html

liunx

Guest
Hello... <br />
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - I have a question. <br />
Just made a complete (update )website in php, cos a client wants to edit the text on this site, without her having to learn html. <br />
I used this code (works perfectly): <br />
<? php <br />
include ('welkom.txt'); <br />
?> <br />
<br />
I just found out her server does not support php. <br />
All the work is not useless, when I find a code to do the same thing , but then in css or html > SO display text she writes in notepad, and which she will upload to a server. And the webpage just opens that txt file and displays it in the page itself . <br />
<br />
Is there a code for that??? <br />
something like < scr= url('welkom.txt') ?????? <br />
<br />
Thanx for helping / <br />
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - figidigi<!--content-->might be able to do it in javascript<!--content-->Wow, that was fast. Thanx!<br />
<br />
Yep, javascript maybe that could work aswell, but I never wrote any, only used prepared ones.<br />
<br />
Do you have an idea what the script should look like, or should I try to use other forums, that are specialized in javascript?<br />
<br />
bye<br />
<br />
figidgi<!--content-->well, we have a few javascript gurus here - i'll move the thread to somewhere where they will notice it.<br />
<br />
i don't know about including a straight text file like that, but I'm sure someone will be better able to answer the question.<!--content-->That's very kind of you<br />
<br />
thanx again. If I succeed with this txt-file thingy, I don't have to totally rewrite the site, which will save a lot of work.<br />
<br />
bye<br />
<br />
figidigi<!--content-->add this to your page.<br />
<br />
<script src=http://www.htmlforums.com/archive/index.php/"welkom.txt"></script><br />
<br />
I think that should work. if not you are stuck. you can also try a iframe as well.<br />
<br />
<iframe src=http://www.htmlforums.com/archive/index.php/"welkom.txt"></iframe><br />
<br />
just insert thoughs where you want the page to display.<!--content-->Okay I got the script and tried it all kind of different ways... oohh this is tough, it keeps coming up with bugs - error messages, stupid browser! and no content... mmmmm<br />
<br />
I tried to get out the bugs with the I DONT KNOW ***** OF WHAT I AM DOING- attitude :-)<br />
<br />
<SCRIPT LANGUAGE="JavaScript"> <br />
{<br />
SRC=http://www.htmlforums.com/archive/index.php/"txt/welkom.txt";<br />
}<br />
</SCRIPT><br />
<br />
That led to this script...<br />
the bugs are gone, but there is still no content...<br />
<br />
The other idea I tried also, but it doesn't give the wanted results... At first I thought, this must be an easy one as txt is ascii and very easy to handle - I still have the idea that the solution is soooo simple. but this has been a tough one till so far...<br />
<br />
well - bye 4 now - I live in holland otherwise i'd buy u a beer, lol<br />
figidigi<!--content-->this is invalid<br />
<br />
<SCRIPT LANGUAGE="JavaScript"> <br />
{<br />
SRC=http://www.htmlforums.com/archive/index.php/"txt/welkom.txt";<br />
}<br />
</SCRIPT><br />
<br />
<br />
you have to do it the way I said.<br />
<br />
<script src=http://www.htmlforums.com/archive/index.php/"welkom.txt"></script><br />
<br />
<br />
stick that in the body of your page, not the head section.<!--content-->Well this is really tougher then I thought... <br />
<br />
I put the example up just like u said on:<br />
<!-- m --><a class="postlink" href="http://www.showerzone.nl/test/testscript.htm">http://www.showerzone.nl/test/testscript.htm</a><!-- m --><br />
<br />
it gives an error and does not display the 'welkom.txt'<br />
please check the source of the html, to see that I did your script correctly<br />
<br />
Originaly this all has to be put in the iframe, but since I want to get the script right first, I forgot about the iframe for a sec, to minimalize the chances of error.<br />
<br />
To prove that the text is really there u can check this url:<br />
<!-- m --><a class="postlink" href="http://www.showerzone.nl/test/welkom.txt">http://www.showerzone.nl/test/welkom.txt</a><!-- m --><br />
<br />
So the only thing I know that causes all this trouble, is that u assume that I ought to have other parts (not stated in the posts) in the page included as well, that I still have left behind. I quess my page is simply incomplete, not knowing what to add in this stadium.<br />
<br />
bye / <br />
<br />
Jerome : figidigi<!--content-->hmm I could have sworn that it would work. well if you use a iframe then you shouldn't have any problems. whynot jsut do that, same line of code more or less.<!--content-->You'll need a server-side language of some sort to do this, PHP, ASP, or whatever. <br />
<br />
Javascript cannot read or write to server-side files. HTML has no such feature. CSS controls the style of the content and cannot provide any content itself. It has to be server-side. New host perhaps?<!--content-->javascript can read files at the same location as the page - otherwise some of my scripts wouldn't work.<br />
<br />
<br />
if he put it in the iframe, wouldn't the file need to be a proper html file to show the content properly?<!--content-->EXACTLY... horus_kroll is right...<br />
So what I did was this:<br />
<br />
I made a new page with 1 iframe. (this site was already finished earlier - this is the work for an update) I use the old pages, which my client was happy with, and put them behind the iframe, so to speak, so... when u click on a button, the old page comes up. these pages are in html.<br />
The idea is that in these htm pages, I wrote a script like this: <br />
<?php include ('txt/info.txt'); ?> <br />
that one did the trick!<br />
<br />
Now as she wants txt to be rewritten and updated, she wants to rewrite them and upload herself. this can be done in txt files, or in html files using notepad or ms-word(where no other code is there, like scripts and all...) She has to rewrite the content and upload it to a special folder, without seeing or touching the actual programmers work - that's the goal.<br />
<br />
I thought i use php and that worked perfectly on my server, but she uses another server. her question, can u still do it? she can't be expected to leave her server for a website update. [well not unless i've tried anything that is possible]<br />
<br />
I thought, if I use the principle ... but copy it to javascript or htmltags, it wouldn't be that hard, cos html or txt must be easy to process, right? they r both the basis of html. all we do to please a client right... sigh:-)<br />
<br />
figidigi<!--content-->I would just use an SSI tag if the server supports SSI, most do. <br />
<br />
<!--#include file="welkom.txt" --><!--content-->hI GUYS ...<br />
<br />
Well I did dive into the whole ssi | asp thing<br />
<br />
read an article from Katherine Nolan <br />
she sais the following ...<br />
<br />
"Whether you include a .htm or a .txt file you need to remove everything from the page except the content that is to be included. That is to say you should remove the <html></html> tags, the <head></head> tags and everything between them, and the <body></body> tags. "<br />
<br />
This means that my complete lay-out will be gone. My client will never agree to that.<br />
<br />
I found... (me mr smartass ) a solution though...<br />
Use her non-php server for the whole site, then link to my server for all the php files (only the htm - pics are on the non-php server) then use the files my client uploaded on the non-php server to display.<br />
So I just use php for displaying her uploads... smart huh??? lol / I think I make an estimate for the costs an I bet ya she will agree to that<br />
<br />
So thanx guys for trying and all... please send me your bank numbers cos I'll share the profit, hows that!!<br />
ha ha ha... I'm joking, if I did couldn't pay my rent I guess... but really thanx anyway. <br />
<br />
figidigi<br />
:P<!--content-->couple corrections, SSI is not just ASP. it is a serverside language all of its own. the file however has to be .shtml for it to work.<br />
<br />
also what the article was talking about is the file that is being included can't have that stuff in it. the file doing the calling has to have all teh html tags in it.<!--content-->your solution is terrible, if I were the "client" I would never agree to that, not that my opinion means all that much.<!--content-->I agree with Kevin that that solution is terrible.<br />
<br />
You are sending data between two servers before the thing is eventually put onto a client - how much network traffic?<!--content-->wELL THANK YOU GUYS . . .<br />
<br />
I don't see another option without changing the situation??!<br />
Anyway, it not elegant, that is true.<br />
<br />
And... u r lucky cos I tried some tests.... It seems that using iframe + 2 servers worked! BUT u had to wait 1 minute for every page to load... THATS terrible, lol<br />
<br />
Unacceptable. So I revered all the editting. She still has to edit the official files.<br />
- - - - -<br />
figidigi<!--content-->then just use SSI<!--content-->say Kevin... <br />
<br />
"your solution is terrible, if I were the "client" I would never agree to that, not that my opinion means all that much."<br />
<br />
FIGIDIGI ; I am very sorry for you, but yesterday my client approved the work and she ordered me to do the job.<br />
I could send the invoice and she'd pay it right away...<br />
<br />
So another months rent will be payed!<br />
<br />
. . . . . .<br />
Figidigi<br />
<br />
<br />
<br />
__________________<!--content-->
 
Back
Top