View Full Version : linking text for the website
hey all,
whats the best way to get the text for the website?
Is it good to write the text yourself directly into the html page. Or is it better to write the text in a text file and then get the text from it and insert it to the webpage through PHP.
Pauly
May 5th, 2006, 01:10
It depends how the content is used. If you're using the content only once, on a specific page, it's probably best to have the content within the HTML document. If you're using the content over multiple pages, I would use an include so you don't have to edit several copies of it, when you want to update or make a mistake :)
can you please elaborate a bit more about the 'include option' . how can i do that . and also is it not a better idea to read the text from the text file and then insert it to the webpage through PHP, would it take large processing time.
Pauly
May 5th, 2006, 01:22
I wouldn't say it's better, I would say it's opinion based. A PHP include looks a bit like;
<?php include 'file.txt'; ?>
I used to use includes for content, but it really doesn't make any sense if you're only using the content once, on one specific page. If you're using the content in the external file more than once, then by all means use an include.
I guess there is a process time, but it's probably not noticable if they external file is relatively small.
Oh, and moved to programming ;)
well, what if the content is changing. What is the better option then.
the_pm
May 5th, 2006, 15:09
well, what if the content is changing. What is the better option then.I don't think this really makes much difference. If the content is changing, but is located in only one place, then you can just as easily change it within the HTML document as you would from within a database or an include file. If the text is used in multiple locations, then an include/database option might be justifiable. What's easier, opening up an HTML document and changing text, or opening up a database or an external flat file and changing text? I would gather it to be about the same.
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.