#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2014
    Posts
    1
    Rep Power
    0

    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:
    Code:
    Title example 1
    Description example 1
    Link example 1
    Title example 2
    Description example 2
    link example 2
    So I would need to display "Title example 1" on my website through html, so I can apply some style to it like this:
    Code:
    <Td>
              <Div class="EntryDesc">
                <a href="LINK1" class="blog-article-a"><h3>Title example 1</h3></a>
                <p>Description example 1</p>
              </Div>
            </Td>
    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.
    Any suggestions please?
    Thanks!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    667
    Rep Power
    6
    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
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    68
    Rep Power
    0
    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.
  6. #4
  7. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,066
    Rep Power
    1990
    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...
    1. Read in the text file
    2. Break the text file into individual lines
    3. Parse each line to determine what it is and how to display it
    4. Output the HTML for that line
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2014
    Location
    Lawrence, KS, USA
    Posts
    8
    Rep Power
    0
    You could also use JavaScript to read the text file and write the html/text code. But I like the other responses better because they address the over arching issues.

IMN logo majestic logo threadwatch logo seochat tools logo