January 24th, 2014, 04:34 PM
Input in txt file - output in html?
Hello there all,
I have a website built for a local business and I need something like this if that's even possible to build.
So I would need something like ability to add some info (text and links) in some .txt file on server and to be able to display those informations based on lines in that txt files.
For example, let's say that I have following text file:
So I would need to display "Title example 1" on my website through html, so I can apply some style to it like this:
Title example 1
Description example 1
Link example 1
Title example 2
Description example 2
link example 2
So i need to use it inside html code, based on rows in txt (doesn't have to be txt though) if that's possible.
<a href="LINK1" class="blog-article-a"><h3>Title example 1</h3></a>
<p>Description example 1</p>
Any suggestions please?
January 25th, 2014, 09:03 AM
Any reason you're avoiding a database?
He who knows not and knows not he knows not: he is a fool - shun him. He who knows not and knows he knows not: he is simple - teach him. He who knows and knows not he knows: he is asleep - wake him. He who knows and knows he knows: he is wise - follow him
February 17th, 2014, 06:57 PM
I have a feeling what you're trying to do has been done in countless frameworks and CMS's.
If you really just want to get the website working and so the user can update it easily, look into Word Press.
If you're doing this because you want to learn to web program, look into using a database and a server side language such as php.
February 17th, 2014, 11:58 PM
You need a server-side programming language. If you're starting out I'd suggest learning PHP as that's most likely going to be the easiest starting point.
What you'd need to do is...
- Read in the text file
- Break the text file into individual lines
- Parse each line to determine what it is and how to display it
- Output the HTML for that line
April 11th, 2014, 11:11 AM